/* Styles des démos : mêmes couleurs, police et arrondis que le reste du site. */
.demo { padding: clamp(14px, 2.2vw, 22px); display: grid; gap: 14px; min-width: 0; }
.demo > * { min-width: 0; }
/* Réserve la place des démos pas encore chargées, pour que la page ne saute pas */
.demo[data-lazy="crm"]:empty { min-height: 635px; }
.demo[data-lazy="dashboard"]:empty { min-height: 925px; }
.app-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.app-co { font-weight: 600; font-size: 14px; }
.fict { font-size: 12px; color: var(--muted); }
.fict.note { margin-top: -6px; }
.demo-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.demo-top b { font-weight: 600; font-size: 15px; }
.demo-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.demo h4 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.empty { color: var(--muted); font-size: 14px; }
.action {
  appearance: none; border: 0; border-radius: 999px; background: var(--ink); color: #fff;
  font: inherit; font-size: 14px; font-weight: 500; padding: 9px 16px; cursor: pointer; justify-self: start;
  transition: transform .4s var(--spring), background .4s var(--spring);
}
.action:hover { background: #333; }
.action:active { transform: scale(.97); }
.action.ghost { background: var(--tray); color: var(--ink); }
.action.ghost:hover { background: var(--line); }
.done { font-size: 14px; font-weight: 500; }
.done::before { content: "✓"; color: var(--red); font-weight: 700; margin-right: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { appearance: none; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; padding: 8px 13px; cursor: pointer; text-align: left; transition: border-color .4s var(--spring), background .4s var(--spring); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:disabled { color: var(--muted); cursor: default; border-color: var(--line); }
.chip.mini { font-size: 13px; padding: 5px 10px; }
.tabs, .pipe-tabs, .dash-tabs, .wa-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--tray); justify-self: start; width: fit-content; max-width: 100%; }
.tab { appearance: none; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background .4s var(--spring), color .4s var(--spring); }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(17, 17, 17, .1); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.pill.ok::before { background: var(--ok); }
.screen-in { animation: rise .55s var(--spring) both; }
@keyframes rise { from { transform: translateY(10px); } to { transform: none; } }

/* Messages */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; background: var(--tray); font-size: 15px; min-height: 190px; max-height: 300px; overflow-y: auto; }
.msg { max-width: 84%; padding: 9px 13px; border-radius: 16px; line-height: 1.35; animation: pop .5s var(--spring) both; }
.msg.in { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; }
.msg.out { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); } to { transform: none; } }

/* CRM */
.compose { display: grid; gap: 8px; }
.compose b { font-weight: 600; font-size: 15px; }
.switches { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.switch { appearance: none; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; padding: 3px 0; cursor: pointer; }
.switch i { position: relative; width: 30px; height: 18px; border-radius: 999px; background: #d8d5d2; transition: background .4s var(--spring); }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .4s var(--spring); }
.switch[aria-checked="true"] i { background: var(--ink); }
.switch[aria-checked="true"] i::after { transform: translateX(12px); }
.switch[aria-checked="false"] { color: var(--muted); }
.switch:disabled { cursor: default; opacity: .6; }
.crm { display: grid; grid-template-columns: 148px minmax(0, 1fr); border-radius: 18px; background: var(--tray); padding: 8px; gap: 8px; }
.crm-nav { display: grid; align-content: start; gap: 2px; }
.crm-tab { appearance: none; border: 0; background: none; font: inherit; font-size: 14px; color: var(--muted); text-align: left; padding: 9px 12px; border-radius: 12px; cursor: pointer; white-space: nowrap; transition: background .3s var(--spring), color .3s var(--spring); }
.crm-tab:hover { color: var(--ink); }
.crm-tab[aria-current="true"] { background: #fff; color: var(--ink); font-weight: 500; }
.crm-main { min-width: 0; min-height: 390px; padding: 16px; border-radius: 12px; background: #fff; }
.crm-main > div { display: grid; gap: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.tile { appearance: none; border: 0; font: inherit; color: inherit; text-align: left; display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: var(--tray); cursor: pointer; transition: transform .5s var(--spring); }
.tile:not(:disabled):hover { transform: translateY(-3px); }
.tile:disabled { cursor: default; }
.tile small, .pipe-top small, .client-ca small { font-size: 13px; color: var(--muted); }
.tile b { font-size: 24px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--muted); }
.news { appearance: none; border: 1px solid var(--line); background: #fff; color: inherit; font: inherit; font-size: 14px; width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; text-align: left; padding: 12px 14px; border-radius: 14px; cursor: pointer; }
.news i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.news span { flex: 1 1 200px; }
.news b { font-weight: 600; }
.news em { font-style: normal; font-weight: 500; }
.pipe-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.pipe-top b { display: block; font-size: 21px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pipe-top p { flex: 1 1 200px; text-align: right; font-size: 13px; color: var(--muted); }
.pipe-top .hint-tap { display: none; }
.pipe-tabs { display: none; }
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.col { display: grid; align-content: start; gap: 6px; min-height: 240px; padding: 8px; border-radius: 14px; background: var(--tray); transition: box-shadow .3s var(--spring); }
.col.over { box-shadow: inset 0 0 0 2px var(--red); }
.col header { display: grid; padding: 2px 4px 4px; font-size: 13px; }
.col header b { font-weight: 600; }
.col header span { color: var(--muted); font-variant-numeric: tabular-nums; }
.col.won header b::after { content: " ✓"; color: var(--ok); }
.col .empty { font-size: 13px; padding: 4px; }
.deal { appearance: none; border: 0; width: 100%; font: inherit; color: inherit; text-align: left; display: grid; padding: 9px 10px; border-radius: 11px; background: #fff; box-shadow: 0 1px 2px rgba(17, 17, 17, .08); cursor: grab; touch-action: manipulation; user-select: none; transition: transform .4s var(--spring); }
.deal:hover { transform: translateY(-2px); }
.deal b { font-size: 14px; font-weight: 600; line-height: 1.2; }
.deal span { font-size: 12px; color: var(--muted); }
.deal em { font-style: normal; font-size: 13px; font-weight: 500; margin-top: 3px; font-variant-numeric: tabular-nums; }
.deal.lifted { opacity: .3; }
.deal.ghost { position: fixed; z-index: 5; margin: 0; pointer-events: none; cursor: grabbing; box-shadow: 0 18px 36px -14px rgba(17, 17, 17, .45); }
.move { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 2px 2px; }
.move small { width: 100%; font-size: 12px; color: var(--muted); }
.client-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.client { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; }
.client-id { display: grid; align-content: start; gap: 6px; }
.client-id p { font-size: 14px; color: var(--muted); }
.client-ca { margin-top: 6px; padding: 12px; border-radius: 14px; background: var(--tray); }
.client-ca b { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; display: grid; gap: 12px; border-left: 1px solid var(--line); }
.timeline li { position: relative; display: grid; font-size: 14px; animation: rise .5s var(--spring) both; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.timeline small { font-size: 12px; color: var(--muted); }
.timeline b { font-weight: 600; }
.timeline span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.quote-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.quote-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.lines { display: grid; font-size: 14px; font-variant-numeric: tabular-nums; }
.lines > div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid var(--line); }
.lines .sub { color: var(--muted); }
.lines .tot { font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.lines .mrg { color: var(--ok); font-weight: 500; }
.answer-box { min-height: 72px; padding: 14px; border-radius: 14px; background: var(--tray); font-size: 15px; line-height: 1.45; }

/* Dashboard */
.dash-bar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 20px; align-items: center; }
.dash-sum { font-size: 15px; line-height: 1.35; font-weight: 500; }
.dash-sum small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.dash-tabs { display: none; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.counters { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kpi { padding: 14px; border-radius: 14px; background: var(--tray); min-width: 0; display: grid; }
.kpi small { font-size: 13px; color: var(--muted); }
.kpi b { font-size: clamp(26px, 3.2vw, 38px); font-weight: 600; letter-spacing: -.04em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; line-height: 1.3; color: var(--muted); }
.is-before .kpi b { color: var(--muted); }
.dash-card { display: grid; align-content: start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.dash-card.wide { grid-column: 1 / -1; }
.dash-card header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.dash-card header b { font-weight: 600; font-size: 15px; }
.dash-card header small { display: block; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.readout { font-size: 13px; color: var(--muted); min-height: 18px; font-variant-numeric: tabular-nums; }
.vbars { display: flex; align-items: flex-end; gap: 3px; height: 140px; border-bottom: 1px solid #cfccc8; }
.vbars[data-count="30"] { gap: 2px; }
.vbar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; appearance: none; background: none; border: 0; padding: 0; cursor: pointer; }
.vbar i { display: block; width: 100%; max-width: 34px; height: var(--h); background: var(--ink); border-radius: 3px 3px 0 0; transform-origin: bottom; animation: grow .7s var(--spring) both; animation-delay: calc(var(--i) * 12ms); transition: background .25s var(--spring); }
.vbar:hover i, .vbar:focus-visible i { background: var(--red); }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
.vaxis { display: flex; justify-content: space-between; margin-top: -6px; font-size: 12px; color: var(--muted); }
.motives { display: grid; gap: 8px; }
.motive { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 2px 8px; font-size: 14px; }
.motive i { grid-row: 2; height: 6px; width: var(--w); border-radius: 3px; background: var(--ink); }
.motive b { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.offhours { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.offhours b { font-size: 30px; font-weight: 600; letter-spacing: -.04em; color: var(--red); font-variant-numeric: tabular-nums; white-space: nowrap; }
.is-before .offhours b { color: var(--muted); }
.offhours span { font-size: 13px; line-height: 1.3; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; line-height: 1.3; }
.feed li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
.feed li.fresh { animation: pop .6s var(--spring) both; font-weight: 500; }
.feed time { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }

/* Agent vocal */
.call-pick { display: grid; gap: 8px; }
.call-pick b { font-weight: 600; font-size: 15px; }
.call-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wave { display: flex; align-items: center; gap: 2px; height: 30px; }
.wave i { width: 3px; height: 100%; border-radius: 2px; background: #cfccc8; transform: scaleY(.14); }
.wave.live i { background: var(--red); animation: wave 900ms ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes wave { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
.call-end { display: grid; gap: 6px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); animation: rise .5s var(--spring) both; }
.call-end small { font-size: 12px; color: var(--muted); }
.call-end p { font-size: 15px; font-weight: 500; line-height: 1.35; }

/* WhatsApp */
.wa-tabs { display: none; }
.wa { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 12px; align-items: start; }
.phone { display: grid; gap: 10px; padding: 10px; border-radius: 28px; background: var(--ink); }
.phone-head { display: grid; padding: 4px 10px; color: #fff; font-size: 14px; }
.phone-head b { font-weight: 600; }
.phone-head small { font-size: 12px; opacity: .7; }
.phone .chat { min-height: 220px; max-height: 260px; background: #fff; }
.phone .chips { padding: 0 2px 4px; }
.phone .chip { background: #222; border-color: #444; color: #fff; font-size: 13px; }
.phone .chip:hover { border-color: #fff; }
.phone .chip:disabled { color: #8a8886; border-color: #333; }
.msg.in-right { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--tray); border-bottom-left-radius: 5px; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 11px 13px; border-radius: 16px; background: var(--tray); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.owner { display: grid; gap: 8px; }
.owner > small { font-size: 13px; font-weight: 500; }
.owner > div { display: grid; gap: 8px; }
.notice { display: grid; gap: 4px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); font-size: 14px; animation: pop .5s var(--spring) both; }
.notice b { font-weight: 600; }
.notice p { color: var(--muted); font-size: 13px; line-height: 1.35; }
.notice .done { font-size: 13px; }

/* E-mails */
.group-title { padding: 10px 6px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.group-title.hot { color: var(--red); }
.mail { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 6px; border-top: 1px solid var(--line); font-size: 15px; animation: pop .5s var(--spring) both; }
.mail span:first-child { min-width: 0; }
.mail small { display: block; color: var(--muted); font-size: 13px; }
.mail .action { padding: 6px 12px; font-size: 13px; }
.mail .sent { font-size: 13px; font-weight: 500; white-space: nowrap; }
.mail .sent::before { content: "✓ "; color: var(--red); font-weight: 700; }

/* Sur mesure : quatre cases à cocher */
.stepper { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.step-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; min-width: 0; padding: clamp(20px, 2.6vw, 32px); border-radius: 22px; box-shadow: inset 0 0 0 1.5px #b9b6b2; }
.step-card small { font-size: 14px; font-weight: 600; color: var(--muted); }
.step-card h3 { margin: 0; font-size: clamp(24px, 2.6vw, 32px); }
.step-card p { font-size: clamp(16px, 1.4vw, 17px); line-height: 1.45; color: #3d3c3a; }
.step-check { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 16px; border-top: 1.5px solid #d4d1cd; font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer; }
.step-check input { appearance: none; -webkit-appearance: none; flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin: 0; border: 2px solid var(--ink); border-radius: 7px; background: #fff; cursor: pointer; transition: background .25s var(--spring), border-color .25s var(--spring); }
.step-check input::after { content: "✓"; color: #fff; font-size: 17px; font-weight: 700; line-height: 1; transform: scale(0); transition: transform .3s var(--spring); }
.step-check input:checked { background: var(--red); border-color: var(--red); }
.step-check input:checked::after { transform: none; }
.step-check input:disabled { cursor: default; }
.step-card.is-current { box-shadow: inset 0 0 0 2.5px var(--red); }
.step-card.is-current small { color: var(--red); }
.step-card.is-done { background: var(--tray); box-shadow: inset 0 0 0 1.5px #b9b6b2; }
.step-card.is-next .step-check { color: var(--muted); cursor: default; }
.step-card.is-next .step-check input { border-color: #8a8784; }

/* Mobile : un écran à la fois */
@media (max-width: 820px) {
  .demo[data-lazy="crm"]:empty { min-height: 860px; }
  .demo[data-lazy="dashboard"]:empty { min-height: 640px; }
  .crm { grid-template-columns: minmax(0, 1fr); }
  .crm-nav { display: flex; overflow-x: auto; scrollbar-width: none; }
  .crm-tab { padding: 7px 10px; }
  .crm-main { padding: 12px; min-height: 340px; }
  .pipe-top p { flex-basis: 100%; text-align: left; }
  .pipe-top .hint-drag { display: none; }
  .pipe-top .hint-tap { display: block; }
  .pipe-tabs { display: flex; width: 100%; }
  .pipe-tabs .tab { flex: 1; padding: 7px 4px; font-size: 13px; }
  .pipe { grid-template-columns: minmax(0, 1fr); }
  .col { display: none; min-height: 0; }
  .col.shown { display: grid; }
  .client { grid-template-columns: minmax(0, 1fr); }
  .dash-bar { grid-template-columns: minmax(0, 1fr); }
  .dash-tabs { display: flex; width: 100%; }
  .dash-tabs .tab { flex: 1; padding: 7px 2px; font-size: 13px; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash-panel { display: none; }
  .dash[data-tab="stats"] [data-panel="stats"], .dash[data-tab="site"] [data-panel="site"], .dash[data-tab="calls"] [data-panel="calls"], .dash[data-tab="feed"] [data-panel="feed"] { display: grid; }
  .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wa-tabs { display: flex; width: 100%; }
  .wa-tabs .tab { flex: 1; }
  .wa { grid-template-columns: minmax(0, 1fr); }
  .wa[data-show="phone"] .owner, .wa[data-show="owner"] .phone { display: none; }
  .demo-foot .btn { width: 100%; justify-content: space-between; }
  .stepper { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .wave.live i { transform: scaleY(.6); }
}
