:root {
  --bg: #12110e;
  --bg-2: #1b1a16;
  --panel: #22211c;
  --line: #34322b;
  --ink: #f3efe6;
  --ink-2: #b9b3a5;
  --ink-3: #7d786c;
  --accent: #d9f27a;
  --accent-ink: #1a1d0c;
  --warm: #f0b26b;
  --radius: 14px;
  --rail-w: 15rem;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; }

#app {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "top top" "rail stage" "rail gen";
}

/* Barre du haut */
.topbar {
  grid-area: top;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; letter-spacing: .01em; color: var(--ink-2); font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.brand .dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.brand .sep { color: var(--ink-3); }
#chapter-kicker { color: var(--ink); }
.counter { display: flex; align-items: baseline; gap: .6rem; }
.counter-num { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.counter-label { color: var(--ink-2); font-size: .95rem; }
.counter.bump .counter-num { animation: bump .5s ease; }
@keyframes bump { 30% { transform: scale(1.25); } }

/* Rail des chapitres */
.rail { grid-area: rail; padding: .8rem 1rem .8rem 1.6rem; border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.rail ol { list-style: none; margin: 0; padding: 0; position: relative; }
.rail ol::before { content: ""; position: absolute; left: .55rem; top: .6rem; bottom: .6rem; width: 2px; background: var(--line); }
.rail li { position: relative; padding: .42rem 0 .42rem 2rem; cursor: pointer; color: var(--ink-3); font-size: .98rem; line-height: 1.25; transition: color .4s; }
.rail li::before {
  content: ""; position: absolute; left: .2rem; top: .65rem; width: .75rem; height: .75rem; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line); transition: all .4s;
}
.rail li .num { display: block; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.rail li.done { color: var(--ink-2); }
.rail li.done::before { background: var(--ink-3); border-color: var(--ink-3); }
.rail li.current { color: var(--ink); font-weight: 600; }
.rail li.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent); }

/* Scène */
.stage { grid-area: stage; position: relative; overflow: hidden; padding: 2rem 2.5rem 1rem; }
.scene { position: absolute; inset: 2rem 2.5rem 1rem; display: flex; flex-direction: column; gap: 1.2rem; animation: fadein .6s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.scene-head { display: flex; align-items: baseline; gap: 1.2rem; }
.scene-num { font-size: 1rem; color: var(--accent); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.scene-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 3.6vw, 3.4rem); line-height: 1.05; }
.scene-sub { margin: 0; color: var(--ink-2); font-size: 1.25rem; max-width: 60rem; }
.scene-body { flex: 1; min-height: 0; position: relative; }

/* Barre de génération */
.genbar {
  grid-area: gen; display: grid; grid-template-columns: auto 1fr 18rem; grid-template-rows: auto auto; gap: .35rem 1.2rem;
  align-items: center; padding: .9rem 2.5rem 1.1rem; border-top: 1px solid var(--line); min-height: 5.2rem;
  transition: opacity .4s;
}
.genbar.idle { opacity: .35; }
.gen-tool { grid-row: 1 / 3; display: flex; align-items: center; gap: .6rem; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.gen-tool::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ink-3); }
.genbar.running .gen-tool::before { background: var(--accent); animation: pulse 1s infinite; }
.genbar.ok .gen-tool::before { background: var(--accent); }
@keyframes pulse { 50% { opacity: .2; } }
.gen-label { font-size: 1.05rem; }
.gen-label .ok { color: var(--accent); margin-left: .5rem; }
.gen-progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.gen-progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.gen-log { grid-column: 2 / 4; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Écran d'accueil */
.splash { position: fixed; inset: 0; background: radial-gradient(ellipse at 30% 20%, #2a2a1c, var(--bg) 60%); display: grid; place-items: center; z-index: 10; }
.splash-inner { max-width: 52rem; padding: 2rem; }
.splash-kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
.splash h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(3rem, 7vw, 6rem); margin: .2em 0; line-height: 1; }
.splash-sub { color: var(--ink-2); font-size: 1.4rem; line-height: 1.4; }
.splash button { margin-top: 1.5rem; background: var(--accent); color: var(--accent-ink); border: 0; padding: .9rem 2.2rem; border-radius: 999px; font-size: 1.2rem; font-weight: 700; cursor: pointer; }
.splash-keys { color: var(--ink-3); font-size: .9rem; margin-top: 2rem; }

.paused { position: fixed; top: 5.5rem; right: 2rem; background: var(--warm); color: #231505; font-weight: 700; padding: .35rem .9rem; border-radius: 999px; z-index: 5; }

/* Médias génériques */
.media { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.media img, .media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.media.contain img, .media.contain video { object-fit: contain; }
.media .tag { position: absolute; left: .7rem; bottom: .7rem; background: rgba(10,10,8,.75); backdrop-filter: blur(6px); color: var(--ink); padding: .3rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 1rem; color: var(--ink-3); font-size: .95rem;
  background: repeating-linear-gradient(135deg, #1f1e19 0 14px, #24231d 14px 28px); }
.pop { animation: pop .7s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(14px); } to { opacity: 1; transform: none; } }

/* Layout : hero (un grand média + texte) */
.l-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; height: 100%; }
.l-hero .media { height: 100%; }
.l-hero .side { display: flex; flex-direction: column; gap: 1rem; justify-content: center; }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; font-size: 1.15rem; line-height: 1.45; color: var(--ink-2); }
.note strong { color: var(--ink); }
.prompt { font-family: ui-monospace, Menlo, monospace; font-size: 1rem; color: var(--ink); background: #0d0c0a; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; line-height: 1.5; }
.prompt::before { content: "Prompt"; display: block; color: var(--accent); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .4rem; font-family: var(--font); font-weight: 700; }

/* Dessin trait par trait */
.sketch { position: relative; height: 100%; background: #f4f1ea; }
.sketch img { object-fit: contain !important; clip-path: inset(0 100% 0 0); animation: draw var(--draw, 6s) cubic-bezier(.45,.05,.4,1) forwards; }
@keyframes draw { to { clip-path: inset(0 0 0 0); } }
.sketch .pen { position: absolute; top: 50%; width: 3px; height: 70%; background: linear-gradient(transparent, #333, transparent); left: 0; transform: translateY(-50%); animation: pen var(--draw, 6s) cubic-bezier(.45,.05,.4,1) forwards; opacity: .4; }
@keyframes pen { to { left: 100%; opacity: 0; } }

/* Layout : grille */
.l-grid { display: grid; gap: 1rem; height: 100%; grid-template-columns: repeat(var(--cols, 3), 1fr); grid-auto-rows: 1fr; }
.l-grid .media { min-height: 0; }

/* Layout : formats réseaux */
.l-formats { display: flex; gap: 1.2rem; height: min(100%, 21vw); margin: auto 0; align-items: center; justify-content: center; }
.l-formats .media { height: 100%; flex: none; }
.l-formats .r-9-16 { aspect-ratio: 9 / 16; }
.l-formats .r-2-3 { aspect-ratio: 2 / 3; height: 92%; }
.l-formats .r-1-1 { aspect-ratio: 1 / 1; height: 70%; }
.l-formats .r-4-5 { aspect-ratio: 4 / 5; height: 80%; }
.l-formats .r-16-9 { aspect-ratio: 16 / 9; height: 52%; }

/* Layout : vidéo multilingue */
.l-video { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.5rem; height: 100%; }
.l-video .media { height: 100%; }
.langs { display: flex; flex-direction: column; gap: .6rem; }
.lang { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-3); transition: all .4s; }
.lang .code { font-weight: 800; width: 2.4rem; }
.lang .line { font-size: 1rem; line-height: 1.35; }
.lang.ready { color: var(--ink-2); }
.lang.active { border-color: var(--accent); color: var(--ink); background: #1e2112; }
.subtitle { position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%); max-width: 85%; text-align: center; background: rgba(0,0,0,.72); padding: .5rem 1rem; border-radius: 8px; font-size: 1.35rem; line-height: 1.35; }

/* Layout : document qui s'écrit */
.l-docs { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 1.2rem; height: 100%; }
.doc { background: #f6f3ec; color: #1d1c18; border-radius: var(--radius); padding: 1.5rem 1.7rem; overflow: hidden; font-size: 1.02rem; line-height: 1.5; position: relative; }
.doc h3 { margin: 0 0 .2rem; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }
.doc .doc-kind { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: #7a7466; font-weight: 700; margin-bottom: .6rem; }
.doc p { margin: .5rem 0; }
.doc ul { margin: .4rem 0; padding-left: 1.2rem; }
.doc .caret { display: inline-block; width: .5em; height: 1.1em; background: #1d1c18; vertical-align: text-bottom; animation: pulse .8s infinite; }

/* Audio */
.audio { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: .8rem; }
.wave { display: flex; align-items: center; gap: 3px; height: 3.5rem; }
.wave span { flex: 1; background: var(--accent); border-radius: 2px; height: 20%; transition: height .12s; }
.audio .who { font-weight: 700; }
.audio .txt { color: var(--ink-2); font-size: 1.05rem; line-height: 1.45; }

/* Page e-commerce simulée */
.l-shop { height: 100%; display: flex; justify-content: center; }
.browser { width: min(100%, 72rem); height: 100%; background: #fff; color: #1a1a1a; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.browser-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; background: #ecebe8; }
.browser-bar i { width: .7rem; height: .7rem; border-radius: 50%; background: #cfccc5; }
.browser-url { flex: 1; margin-left: .6rem; background: #fff; border-radius: 6px; padding: .3rem .8rem; font-size: .85rem; color: #555; }
.browser-langs { display: flex; gap: .3rem; font-size: .8rem; font-weight: 700; }
.browser-langs span { padding: .15rem .45rem; border-radius: 4px; color: #888; }
.browser-langs span.on { background: #1a1a1a; color: #fff; }
.shop { flex: 1; overflow: hidden; display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; padding: 1.6rem 2rem; }
.shop-gallery { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: .6rem; min-height: 0; }
.shop-gallery .media { border: 0; background: #f2f0ec; }
.shop-gallery .media:first-child { grid-column: span 2; }
.shop-info { display: flex; flex-direction: column; gap: .8rem; overflow: hidden; }
.shop-info h2 { margin: 0; font-size: 2rem; font-family: var(--serif); font-weight: 600; }
.shop-price { font-size: 1.4rem; font-weight: 700; }
.shop-desc { color: #444; line-height: 1.5; font-size: 1rem; }
.shop-sizes { display: flex; gap: .4rem; flex-wrap: wrap; }
.shop-sizes span { border: 1px solid #ccc; padding: .35rem .6rem; border-radius: 6px; font-size: .9rem; }
.shop-btn { background: #1a1a1a; color: #fff; text-align: center; padding: .85rem; border-radius: 8px; font-weight: 700; }
.shop-faq { border-top: 1px solid #e4e2dd; padding-top: .6rem; font-size: .92rem; color: #333; }
.shop-faq b { display: block; margin-top: .4rem; }
.build { animation: build .6s ease both; }
@keyframes build { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* Avis clients */
.l-reviews { height: 100%; display: grid; grid-template-columns: 1fr 22rem; gap: 1.5rem; }
.reviews-feed { overflow: hidden; display: flex; flex-direction: column; gap: .7rem; mask-image: linear-gradient(transparent, #000 8%, #000 85%, transparent); padding-top: 1rem; }
.review { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: grid; grid-template-columns: auto 1fr; gap: .2rem .9rem; animation: slidein .5s ease both; }
@keyframes slidein { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.review .stars { color: var(--warm); letter-spacing: .1em; font-size: .95rem; }
.review .meta { color: var(--ink-3); font-size: .85rem; }
.review .body { grid-column: 1 / 3; font-size: 1.02rem; line-height: 1.4; color: var(--ink-2); }
.review .chip { display: inline-block; margin-left: .4rem; font-size: .72rem; padding: .1rem .5rem; border-radius: 999px; background: #2e2d25; color: var(--ink-2); }
.kpis { display: flex; flex-direction: column; gap: 1rem; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.kpi b { display: block; font-size: 2.6rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi span { color: var(--ink-2); }

/* Traitement des avis */
.l-themes { height: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.themes { display: flex; flex-direction: column; gap: .8rem; }
.theme { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1.1rem; }
.theme-top { display: flex; justify-content: space-between; font-weight: 600; font-size: 1.1rem; }
.theme-top .n { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.theme-bar { height: 8px; border-radius: 4px; background: var(--line); margin: .5rem 0 .3rem; overflow: hidden; }
.theme-bar div { height: 100%; width: 0; border-radius: 4px; transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.theme-bar .pos { background: var(--accent); }
.theme-bar .neg { background: var(--warm); }
.theme-quote { color: var(--ink-3); font-size: .92rem; font-style: italic; }
.actions { display: flex; flex-direction: column; gap: .8rem; overflow: hidden; }
.reply { background: #f6f3ec; color: #1d1c18; border-radius: var(--radius); padding: 1rem 1.2rem; font-size: .98rem; line-height: 1.45; }
.reply .doc-kind { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #7a7466; font-weight: 700; margin-bottom: .3rem; }

/* Bilan */
.l-summary { height: 100%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: auto 1fr; gap: 1.2rem; }
.big { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.big b { display: block; font-size: clamp(3rem, 6vw, 5.5rem); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.big span { color: var(--ink-2); font-size: 1.2rem; }
.mosaic { grid-column: 1 / 4; display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 1fr; gap: .5rem; min-height: 0; }
.mosaic .media { border-radius: 8px; }
.tools { grid-column: 1 / 4; display: flex; gap: .6rem; flex-wrap: wrap; }
.tools span { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; color: var(--ink-2); }

/* Ouverture vidéo plein cadre */
.l-full { height: 100%; }
.l-full .media { height: 100%; background: #000; }
.l-full .media video { object-fit: contain; }

/* Mode impression / export PDF */
body.static .genbar, body.static .splash, body.static .paused { display: none !important; }
body.static * { animation-duration: 0s !important; animation-delay: 0s !important; transition: none !important; }
body.static .sketch img { clip-path: none; }
body.static .sketch .pen { display: none; }

/* Layout : interface d'assistant IA fictive (passage d'une étape à l'autre) */
.l-agent { height: 100%; display: flex; justify-content: center; }
.app { width: min(100%, 78rem); height: 100%; display: grid; grid-template-columns: 15rem 1fr; background: #f7f5f0; color: #1c1b17; border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.app-side { background: #ecE9e1; padding: 1.1rem 1rem; display: flex; flex-direction: column; gap: .4rem; border-right: 1px solid #ddd8cc; }
.app-name { font-weight: 800; font-size: 1.05rem; margin-bottom: .8rem; display: flex; align-items: center; gap: .5rem; }
.app-name::before { content: ""; width: 1.1rem; height: 1.1rem; border-radius: 5px; background: linear-gradient(135deg, #b5d94a, #4f8a3c); }
.app-side h4 { margin: .6rem 0 .2rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #8a8576; }
.app-tool { display: flex; align-items: center; gap: .55rem; padding: .4rem .55rem; border-radius: 8px; font-size: .92rem; color: #4a473f; transition: all .3s; }
.app-tool i { width: .5rem; height: .5rem; border-radius: 50%; background: #7fae4f; }
.app-tool.busy { background: #fff; color: #1c1b17; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.app-tool.busy i { animation: pulse .8s infinite; background: #e08a2e; }
.app-main { display: flex; flex-direction: column; gap: 1rem; padding: 1.4rem 1.8rem; overflow: hidden; }
.msg-user { align-self: flex-end; max-width: 75%; background: #1c1b17; color: #f7f5f0; padding: .8rem 1.1rem; border-radius: 16px 16px 4px 16px; font-size: 1.08rem; line-height: 1.45; min-height: 2.8rem; }
.msg-user .caret, .msg-ai .caret { background: currentColor; }
.msg-ai { max-width: 92%; display: flex; flex-direction: column; gap: .6rem; }
.steps { display: flex; flex-direction: column; gap: .35rem; }
.step { display: flex; align-items: center; gap: .6rem; font-size: .98rem; color: #5b574d; animation: slidein .4s ease both; }
.step .ic { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid #c9c3b4; border-top-color: #4f8a3c; animation: spin .8s linear infinite; flex: none; }
.step.done .ic { animation: none; border: 0; background: #4f8a3c; color: #fff; display: grid; place-items: center; font-size: .7rem; }
.step.done .ic::after { content: "✓"; }
.step .via { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; background: #ebe7dd; padding: .1rem .45rem; border-radius: 5px; color: #6a6559; }
@keyframes spin { to { transform: rotate(360deg); } }
.answer { font-size: 1.06rem; line-height: 1.5; color: #1c1b17; }
.outputs { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: .6rem; height: 11rem; }
.outputs .media { background: #e6e2d8; border: 0; }
.outputs .ph { background: repeating-linear-gradient(135deg, #e6e2d8 0 12px, #ece8df 12px 24px); color: #8a8576; }
.outputs .file { background: #fff; border: 1px solid #e0dbcf; border-radius: 10px; padding: .8rem; font-size: .9rem; display: flex; flex-direction: column; gap: .3rem; }
.outputs .file b { font-size: .95rem; }
.outputs .file span { color: #8a8576; font-size: .8rem; }
.outputs.files { height: auto; }

/* Branding de gamme */
.l-brand { height: 100%; display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.2rem; }
.brand-mood .media { border-radius: var(--radius); }
.brand-side { display: flex; flex-direction: column; gap: .9rem; min-height: 0; }
.brand-card { background: #f6f3ec; color: #1d1c18; border-radius: var(--radius); padding: .9rem 1.1rem; }
.brand-card .doc-kind { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #7a7466; font-weight: 700; margin-bottom: .5rem; }
.brand-names { display: flex; flex-wrap: wrap; gap: .45rem; }
.brand-names span { border: 1px solid #d6d1c4; border-radius: 999px; padding: .3rem .8rem; font-size: .95rem; color: #6b665a; transition: all .4s; }
.brand-names span.on { background: #1b2a4a; border-color: #1b2a4a; color: #fff; font-weight: 700; }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; }
.swatch i { display: block; aspect-ratio: 1; border-radius: 10px; border: 1px solid rgba(0,0,0,.08); margin-bottom: .35rem; }
.swatch b { display: block; font-size: .85rem; }
.swatch span { font-size: .72rem; color: #7a7466; font-variant-numeric: tabular-nums; }
.brand-logo { display: flex; align-items: center; gap: 1.2rem; }
.brand-logo img { height: 4.6rem; }
.brand-logo .wordmark { font-weight: 800; letter-spacing: .32em; font-size: 1.7rem; color: #1b2a4a; }
.brand-logo .sub { letter-spacing: .3em; text-transform: uppercase; font-size: .8rem; color: #b8362c; font-weight: 700; margin-top: .2rem; }

/* Site de gamme */
.site { flex: 1; overflow: hidden; display: flex; flex-direction: column; background: #f7f4ee; }
.site-nav { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.6rem; border-bottom: 1px solid #e4e0d6; }
.site-nav img { height: 1.6rem; }
.site-nav b { letter-spacing: .3em; color: #1b2a4a; font-size: 1.05rem; }
.site-links { margin-left: auto; display: flex; gap: 1.4rem; font-size: .88rem; color: #1b2a4a; }
.site-links span.on { border-bottom: 2px solid #b8362c; }
.site-hero { position: relative; flex: 1.5; min-height: 0; overflow: hidden; }
.site-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-hero-txt { position: absolute; left: 2.2rem; top: 50%; transform: translateY(-50%); max-width: 42%; color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.site-hero-txt .k { letter-spacing: .3em; text-transform: uppercase; font-size: .8rem; font-weight: 700; }
.site-hero-txt h2 { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.8rem); margin: .4rem 0 1rem; line-height: 1.1; }
.site-hero-txt .cta { display: inline-block; background: #fff; color: #1b2a4a; padding: .6rem 1.1rem; border-radius: 4px; font-weight: 700; font-size: .9rem; text-shadow: none; }
.site-cards { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; padding: .9rem 1.6rem; }
.site-card { display: flex; flex-direction: column; min-height: 0; }
.site-card img { flex: 1; min-height: 0; width: 100%; object-fit: cover; border-radius: 4px; background: #ece8df; }
.site-card .t { font-size: .85rem; color: #1b2a4a; padding-top: .35rem; }
.site-card .t b { display: block; }

/* ---------- Rail cliquable ---------- */
.rail li { cursor: pointer; padding-top: .38rem; padding-bottom: .38rem; }
.rail li::before { top: .6rem; }
.rail li:hover { color: var(--ink); }

/* ---------- Choix du parcours ---------- */
.chooser { position: absolute; right: 2.5rem; bottom: 1.2rem; z-index: 5; background: rgba(27,26,22,.96); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem .8rem; box-shadow: 0 20px 60px rgba(0,0,0,.55); max-width: min(46rem, 90%); }
.chooser-k { color: var(--accent); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; margin-bottom: .6rem; }
.chooser-opts { display: flex; gap: .7rem; }
.chooser button { position: relative; overflow: hidden; text-align: left; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: .75rem 1rem; cursor: pointer; min-width: 13rem; transition: border-color .2s, transform .2s; }
.chooser button:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.chooser button b { display: block; font-size: 1.02rem; }
.chooser button span { color: var(--ink-2); font-size: .9rem; }
.chooser button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chooser button.primary span { color: #3b4220; }
.chooser-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.12); }
.chooser-timer i { display: block; height: 100%; width: 0; background: var(--accent-ink); opacity: .45; transition: width .1s linear; }
.chooser-hint { color: var(--ink-3); font-size: .82rem; margin-top: .55rem; }

/* ---------- SMS ---------- */
.l-sms { height: 100%; display: grid; grid-template-columns: auto 1fr; gap: 3rem; align-items: center; justify-content: center; padding: 0 4rem; }
.l-sms .side { display: flex; flex-direction: column; gap: 1rem; max-width: 30rem; }
.phone { height: min(100%, 40rem); aspect-ratio: 9 / 18; background: #fbfaf7; color: #1c1b17; border-radius: 2.6rem; border: 10px solid #0b0b0a; box-shadow: 0 30px 80px rgba(0,0,0,.55); display: flex; flex-direction: column; overflow: hidden; }
.phone-top { display: flex; justify-content: space-between; padding: .55rem 1.3rem .2rem; font-size: .78rem; font-weight: 600; }
.sms-head { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .4rem 0 .7rem; border-bottom: 1px solid #e6e2d8; background: #f3f1ec; }
.sms-head .avatar { width: 2.8rem; height: 2.8rem; border-radius: 50%; background: linear-gradient(135deg, #1B2A4A, #5D6670); color: #EFE8D8; display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; }
.sms-head b { font-size: .95rem; }
.sms-head span { font-size: .72rem; color: #8a8576; }
.sms-day { text-align: center; font-size: .72rem; color: #8a8576; padding: .8rem 0 .3rem; }
.sms-thread { flex: 1; display: flex; flex-direction: column; gap: .45rem; padding: .3rem .8rem; overflow: hidden; }
.bubble { max-width: 80%; padding: .55rem .85rem; border-radius: 1.1rem; font-size: .95rem; line-height: 1.38; }
.bubble.them { align-self: flex-start; background: #e9e7e1; border-bottom-left-radius: .3rem; }
.bubble.me { align-self: flex-end; background: #2f7cf6; color: #fff; border-bottom-right-radius: .3rem; }
.bubble.typing { display: flex; gap: .25rem; padding: .7rem .85rem; }
.bubble.typing i { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .45; animation: pulse 1s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; } .bubble.typing i:nth-child(3) { animation-delay: .3s; }
.bubble.me.typing { color: #fff; }
.sms-meta { align-self: flex-end; font-size: .7rem; color: #8a8576; margin-top: -.2rem; }
.sms-input { margin: .6rem .8rem .9rem; border: 1px solid #dcd8ce; border-radius: 999px; padding: .45rem .9rem; display: flex; justify-content: space-between; align-items: center; color: #a39f93; font-size: .85rem; }
.sms-input i { width: 1.3rem; height: 1.3rem; border-radius: 50%; background: #2f7cf6; }

/* ---------- Finances ---------- */
.l-finance { height: 100%; display: grid; grid-template-columns: 1fr 1.35fr; grid-template-rows: auto 1fr; gap: 1rem; }
.fin-kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.fin-kpis .kpi b { font-size: 2.3rem; color: var(--accent); }
.fin-left { display: flex; flex-direction: column; gap: 1rem; min-height: 0; }
.fin-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; min-height: 0; }
.fin-card .doc-kind { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-bottom: .7rem; }
.fin-split { display: flex; height: 1.6rem; border-radius: 6px; overflow: hidden; background: var(--bg-2); }
.fin-split i { display: block; height: 100%; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.fin-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .6rem 0 .5rem; color: var(--ink-2); font-size: .92rem; }
.fin-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.fin-rows > div { display: flex; justify-content: space-between; padding: .38rem 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .98rem; }
.fin-rows b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fin-rows .tot { border-top: 2px solid var(--ink-3); color: var(--ink); font-weight: 700; }
.fin-rows .tot b { color: var(--accent); font-size: 1.15rem; }
.fin-note { margin: .6rem 0 0; color: var(--ink-3); font-size: .9rem; }
.fin-chart { display: flex; flex-direction: column; }
.fin-bars { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: .5rem; align-items: end; padding-top: 2.2rem; }
.fin-bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .3rem; }
.fin-bar i { display: block; width: 100%; border-radius: 5px 5px 0 0; background: var(--accent); transition: height .8s cubic-bezier(.2,.8,.2,1); }
.fin-bar.pre i { background: #5D6670; }
.fin-bar em { font-style: normal; font-size: .8rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fin-bar span { font-size: .8rem; color: var(--ink-3); }
.fin-be { position: absolute; top: -2rem; left: -.25rem; white-space: nowrap; font-size: .78rem; font-weight: 700; color: var(--accent); border-left: 2px dashed var(--accent); padding: 0 0 0 .4rem; height: calc(100% + .5rem); }
.fin-total { margin-top: .8rem; color: var(--ink-2); font-size: 1rem; }

.l-video .subtitle { font-size: 1.12rem; max-width: 78%; }

.brand-note { margin: .5rem 0 0; color: #7a7466; font-size: .9rem; }

/* ---------- Bouton final et chargement ---------- */
.cta-big { align-self: flex-start; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 1.1rem 2rem; font-size: 1.25rem; font-weight: 800; cursor: pointer; box-shadow: 0 0 0 0 rgba(247,139,46,.6); animation: ctaPulse 2s infinite; }
.cta-big:hover { transform: translateY(-2px); }
@keyframes ctaPulse { 0% { box-shadow: 0 0 0 0 rgba(247,139,46,.5); } 70% { box-shadow: 0 0 0 18px rgba(247,139,46,0); } 100% { box-shadow: 0 0 0 0 rgba(247,139,46,0); } }
.press-loader { position: fixed; inset: 0; z-index: 50; background: rgba(10,10,8,.82); display: grid; place-items: center; backdrop-filter: blur(4px); }
.press-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem 2.2rem; width: min(34rem, 90vw); }
.press-card h3 { font-family: var(--serif); font-weight: 500; font-size: 2rem; margin: .2rem 0 1rem; }
.press-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.press-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .8s ease; }
.press-card ul { list-style: none; padding: 0; margin: 1.1rem 0 0; display: grid; gap: .5rem; color: var(--ink-3); }
.press-card li::before { content: "○"; margin-right: .6rem; }
.press-card li.busy { color: var(--ink); } .press-card li.busy::before { content: "◌"; color: var(--warm); }
.press-card li.done { color: var(--ink-2); } .press-card li.done::before { content: "✓"; color: var(--accent); }
.bubble { overflow-wrap: anywhere; }
.media.contain { background: #f3efe8; }
.media.contain .tag { color: #fff; }
.sms-thread { justify-content: flex-end; }
.bubble { font-size: .9rem; }
.doc.wide > div:last-child { column-count: 2; column-gap: 2rem; font-size: .86rem; line-height: 1.36; }
.doc.wide p { margin: .3rem 0; break-after: avoid; }
.doc.wide ul { margin: .2rem 0 .5rem; }
.doc.wide .lead { color: #7a7466; font-size: .88rem; column-span: all; margin-bottom: .6rem; }
.doc.wide p b { break-after: avoid; } .doc.wide p:has(> b:only-child) { break-after: avoid; }
/* Fiche de poste structurée */
.l-docs > .doc:not(.job) { align-self: start; }
.doc.job { font-size: .86rem; line-height: 1.38; overflow: auto; }
.doc.job h3 { margin-bottom: .7rem; }
.job-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.job-tags span { background: #e9e3d5; color: #3d3a32; border-radius: 99px; padding: .22rem .7rem; font-size: .8rem; font-weight: 600; }
.job-tags span:last-child { background: #1B2A4A; color: #f6f3ec; }
.job-grid { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 1.4rem; border-top: 1px solid #e2dccd; padding-top: 1rem; }
.job-col { display: flex; flex-direction: column; gap: 1rem; }
.job-col + .job-col { border-left: 1px solid #e2dccd; padding-left: 1.4rem; }
.doc.job h4 { margin: 0 0 .4rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #8a6d3b; }
.doc.job p { margin: 0; }
.doc.job ul, .doc.job ol { margin: 0; padding-left: 1.05rem; }
.doc.job li { margin: .18rem 0; }
.doc.job li::marker { color: #8a6d3b; }
.doc.job .job-note { margin-top: .5rem; font-style: italic; color: #6d6757; }
/* Choix de la suite : posé dans la barre du bas, ne masque jamais la scène */
.genbar { position: relative; }
.chooser.dock { position: absolute; inset: 0; right: 0; bottom: 0; max-width: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: var(--bg); padding: 0 2.5rem; display: flex; align-items: center; gap: 1.2rem; animation: fadein .4s ease; }
.chooser.dock .chooser-k { margin: 0; white-space: nowrap; }
.chooser.dock .chooser-opts { gap: .6rem; }
.chooser.dock button { padding: .5rem .95rem; min-width: 0; display: flex; align-items: baseline; gap: .6rem; }
.chooser.dock button b { display: inline; font-size: .98rem; white-space: nowrap; }
.chooser.dock button span { font-size: .86rem; white-space: nowrap; }
.chooser.dock .chooser-hint { margin: 0 0 0 auto; white-space: nowrap; }
.doc.job .job-tags { margin-bottom: .8rem; }
.doc.job .job-grid { padding-top: .8rem; }
.doc.job li { margin: .1rem 0; }
.doc.job .job-col { gap: .8rem; }
.doc.job { padding: 1.25rem 1.6rem; }

/* ---------- Patron et nomenclature ---------- */
.l-pattern { height: 100%; display: grid; grid-template-columns: 1fr 1.15fr; grid-template-rows: auto 1fr; gap: 1rem; }
.pat-kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; min-height: 4.4rem; }
.pat-kpis .kpi { padding: .6rem 1rem; display: flex; align-items: baseline; gap: .6rem; }
.pat-kpis .kpi b { font-size: 1.8rem; color: var(--accent); }
.pat-marker { display: flex; flex-direction: column; overflow: hidden; }
.pat-svg { flex: 1; min-height: 0; width: 100%; }
.pat-roll { fill: #1d2a45; stroke: #3b4a6b; stroke-width: .4; }
.pat-piece polygon { fill: rgba(243,239,230,.1); stroke: #f3efe6; stroke-width: .35; stroke-dasharray: 1.2 .6; animation: fadein .4s ease; }
.pat-piece text { fill: #f3efe6; font-size: 4.2px; text-anchor: middle; dominant-baseline: middle; font-family: var(--font, system-ui); opacity: .85; }
.pat-piece text.sm { font-size: 2.6px; }
.pat-bom { overflow: auto; }
.pat-table { width: 100%; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
.pat-table th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: .72rem; padding: 0 .4rem .3rem 0; border-bottom: 1px solid var(--line); }
.pat-table td { padding: .2rem .4rem .2rem 0; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--ink-2); }
.pat-table td:first-child { color: var(--ink); }
.pat-table th:not(:first-child), .pat-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.pat-table tr.sub td { color: var(--ink); font-weight: 700; border-top: 1px solid var(--line); }
.pat-cost td:last-child { text-align: right; }
.pat-table tr.tot td { color: var(--accent); font-weight: 700; font-size: .92rem; border-top: 1px solid var(--ink-3); padding-top: .35rem; }
.l-pattern { grid-template-columns: 1fr 1.1fr; grid-template-rows: auto 1fr auto; grid-template-areas: "k k" "m b" "c b"; }
.pat-kpis { grid-area: k; min-height: 0; }
.pat-marker { grid-area: m; } .pat-bom { grid-area: b; } .pat-costcard { grid-area: c; padding: .8rem 1.2rem; }
.pat-costcard .doc-kind { margin-bottom: .4rem; }
.pat-kpis .kpi b { white-space: nowrap; font-size: 1.6rem; }
.pat-kpis .kpi span { font-size: .9rem; }
.pat-marker .doc-kind { margin-bottom: .5rem; }
/* Finances : un peu plus compact pour tenir sur les écrans portables */
.fin-kpis .kpi { padding: .7rem 1.1rem; }
.fin-kpis .kpi b { font-size: 2rem; }
.fin-rows > div { padding: .28rem 0; font-size: .92rem; }
.fin-left .fin-card { padding: .9rem 1.2rem; }
.fin-left .fin-card .doc-kind { margin-bottom: .5rem; }
.fin-note { margin-top: .4rem; font-size: .85rem; }
/* 3D : fenêtre façon logiciel de CAO, vidéo pilotée au glisser */
.l-turntable { height: 100%; display: grid; grid-template-columns: 1.7fr 1fr; gap: 1rem; min-height: 0; }
.tt-win, .cad-win { display: flex; flex-direction: column; min-height: 0; background: #1a1c20; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tt-bar { display: flex; align-items: center; gap: .8rem; padding: .5rem .9rem; background: #24272d; border-bottom: 1px solid #33373f; font-size: .8rem; color: var(--ink-2); }
.tt-bar b { color: var(--ink); font-weight: 700; }
.tt-bar span:nth-child(2) { font-family: ui-monospace, Menlo, monospace; font-size: .75rem; }
.tt-deg { margin-left: auto; font-family: ui-monospace, Menlo, monospace; color: var(--accent); }
.tt-tools { display: flex; gap: .3rem; padding: .4rem .9rem; border-bottom: 1px solid #33373f; }
.tt-tools span { font-size: .72rem; padding: .2rem .6rem; border-radius: 5px; color: var(--ink-3); border: 1px solid #33373f; }
.tt-tools span.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.tt-view { position: relative; flex: 1; min-height: 0; background: #e4e4e4; cursor: grab; touch-action: none; user-select: none; }
.tt-view:active { cursor: grabbing; }
.tt-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.tt-hint { position: absolute; left: 50%; bottom: .9rem; transform: translateX(-50%); background: rgba(18,17,14,.78); color: #f3efe6; font-size: .78rem; padding: .35rem .8rem; border-radius: 99px; transition: opacity .4s; }
.tt-hint.gone { opacity: 0; }
.tt-axes { position: absolute; left: .9rem; bottom: .9rem; width: 2.4rem; height: 2.4rem; }
.tt-axes i { position: absolute; left: 0; bottom: 0; height: 2px; width: 2.2rem; transform-origin: 0 50%; }
.tt-axes .x { background: #d9433a; } .tt-axes .y { background: #3aa655; transform: rotate(-90deg); } .tt-axes .z { background: #3b6fd8; transform: rotate(-35deg); width: 1.5rem; }
.tt-side, .cad-side { display: flex; flex-direction: column; gap: 1rem; min-height: 0; }
.tt-tab td:last-child { white-space: normal; }
.tt-check { display: flex; align-items: center; gap: .6rem; padding: .38rem 0; font-size: .92rem; border-bottom: 1px solid rgba(255,255,255,.05); }
.tt-check i { font-style: normal; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 800; }
/* Patron industriel */
.l-cad { height: 100%; display: grid; grid-template-columns: 1.55fr 1fr; gap: 1rem; min-height: 0; }
.cad-sheet { flex: 1; min-height: 0; background: #fbfcfe; display: flex; }
.cad-sheet svg, .cad-sheet img { width: 100%; height: 100%; display: block; }
.cad-sheet .off { opacity: 0; }
.cad-sheet .pc, .cad-sheet .gr { transition: opacity .35s ease; }
.cad-sizes { margin-left: auto; display: flex; gap: .25rem; opacity: .35; transition: opacity .4s; }
.cad-sizes.on { opacity: 1; }
.cad-sizes .sz { font-size: .66rem; font-weight: 700; padding: .05rem .35rem; border-radius: 4px; color: #fff; }
.sz-XS { background: #3b6fd8; } .sz-S { background: #2a9d8f; } .sz-M { background: #f3efe6; color: #1d1c18 !important; } .sz-L { background: #e9a23b; } .sz-XL { background: #e76f51; } .sz-XXL { background: #c2185b; } .sz-3XL { background: #7b2cbf; }
.cad-mes, .cad-mk { padding: .9rem 1.1rem; }
.cad-mes .doc-kind, .cad-mk .doc-kind { margin-bottom: .45rem; }
.cad-tab { font-size: .74rem; }
.cad-tab th, .cad-tab td { padding-right: .3rem; }
.cad-tab .m { color: var(--accent); font-weight: 700; }
.cad-bars { display: flex; flex-direction: column; gap: .28rem; }
.cad-bar { display: grid; grid-template-columns: 2.2rem 1fr 3.4rem 3.6rem; align-items: center; gap: .5rem; font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cad-bar b { color: var(--ink); }
.cad-bar span, .cad-bar em { text-align: right; font-style: normal; }
.cad-track { height: .55rem; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.cad-track i { display: block; height: 100%; background: var(--ink-3); border-radius: 4px; }
.cad-bar.m b, .cad-bar.m span { color: var(--accent); } .cad-bar.m .cad-track i { background: var(--accent); }
.pat-marker .cad-bar { grid-template-columns: 2.2rem 1fr 3.4rem; font-size: .86rem; gap: .7rem; }
.pat-marker .cad-bars { gap: .45rem; }
.pat-note { margin: .7rem 0 0; font-size: .8rem; color: var(--ink-3); }
.use-cols { flex: 1; min-height: 4.5rem; display: grid; grid-template-columns: repeat(7, 1fr); gap: .6rem; align-items: stretch; }
.use-col { display: flex; flex-direction: column; align-items: center; gap: .25rem; font-size: .76rem; font-variant-numeric: tabular-nums; color: var(--ink-2); min-height: 0; }
.use-col b { color: var(--ink); font-size: .8rem; }
.use-track { flex: 1; width: 100%; max-width: 2.2rem; display: flex; align-items: flex-end; min-height: 1.5rem; }
.use-track i { display: block; width: 100%; background: var(--ink-3); border-radius: 4px 4px 0 0; }
.use-col.m b, .use-col.m span { color: var(--accent); } .use-col.m .use-track i { background: var(--accent); }
@media (max-height: 780px) {
  .pat-table { font-size: .74rem; }
  .pat-table td { padding: .12rem .4rem .12rem 0; }
  .pat-note { margin-top: .4rem; font-size: .74rem; }
  .pat-kpis .kpi { padding: .45rem .9rem; }
}
@media (max-height: 780px) {
  .pat-bom { padding: .8rem 1.1rem; }
  .pat-bom .doc-kind { margin-bottom: .4rem; }
}
@media (max-height: 780px) {
  .fin-kpis .kpi { padding: .45rem 1rem; }
  .fin-kpis .kpi b { font-size: 1.6rem; }
  .fin-kpis .kpi span { font-size: .85rem; }
  .fin-left .fin-card { padding: .65rem 1.1rem; }
  .fin-left .fin-card .doc-kind { margin-bottom: .35rem; }
  .fin-rows > div { padding: .14rem 0; font-size: .82rem; }
  .fin-split { height: 1.1rem; }
  .pat-table td { padding: .1rem .4rem .1rem 0; }
}
@media (max-height: 780px) {
  .fin-legend { margin: .35rem 0 .25rem; font-size: .82rem; }
  .l-finance { gap: .8rem; }
  .fin-left { gap: .8rem; }
}
/* Accueil minimal */
.splash { background: radial-gradient(ellipse at 50% 45%, #1c1b16, #0b0a08 70%); }
.splash-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.splash h1 { font-size: clamp(4.5rem, 12vw, 10rem); letter-spacing: -.02em; margin: .1em 0 0; animation: fadein 2.4s ease both; }
.splash-date { color: var(--ink-3); text-transform: uppercase; letter-spacing: .32em; font-size: .9rem; margin: 1.2rem 0 0; animation: fadein 2.4s .8s ease both; }
.splash button#start { margin-top: 3.5rem; background: transparent; color: var(--ink-2); border: 1px solid var(--line); padding: .7rem 2.4rem; font-size: .85rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; transition: all .4s; animation: fadein 2s 1.6s ease both; }
.splash button#start:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.splash-pulse { width: .8rem; height: .8rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(247,139,46,.6); animation: pulse-ring 2.2s ease-out infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(247,139,46,.55); } 80%, 100% { box-shadow: 0 0 0 1.6rem rgba(247,139,46,0); } }
.splash-logos { position: absolute; bottom: 2.4rem; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 1.4rem; animation: fadein 2s 2.2s ease both; }
.splash-logos > * { opacity: .8; }
.splash-logos img { height: 2.2rem; width: auto; }
.splash-x { color: var(--ink-3); font-size: .9rem; }
.splash-logos img.logo-hepix { height: 1.7rem; }

/* ================= Mobile et tablette ================= */
@media (max-width: 900px) {
  html, body { height: auto; }
  body { overflow-x: hidden; overflow-y: auto; }
  #app { height: auto; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 6.5rem; }
  .topbar { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: .7rem 1rem; gap: .8rem; }
  .brand { font-size: .9rem; min-width: 0; }
  .brand #chapter-kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .counter-num { font-size: 1.4rem; }
  .counter-label { font-size: .75rem; max-width: 5.5rem; line-height: 1.1; }
  /* Rail : bandeau horizontal */
  .rail { position: sticky; top: 3.3rem; z-index: 5; background: var(--bg); border-right: 0; border-bottom: 1px solid var(--line); padding: .5rem 1rem; overflow-x: auto; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail ol { display: flex; gap: .4rem; }
  .rail ol::before { display: none; }
  .rail li { flex: none; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; white-space: nowrap; }
  .rail li::before { display: none; }
  .rail li .num { display: inline; font-size: .65rem; margin-right: .35rem; }
  .rail li.current { border-color: var(--accent); background: rgba(247,139,46,.1); }
  /* Scène : flux vertical */
  .stage { overflow: visible; padding: 1.2rem 1rem 1rem; }
  .scene { position: relative; inset: auto; gap: 1rem; }
  .scene-head { flex-wrap: wrap; gap: .3rem .8rem; }
  .scene-num { font-size: .8rem; }
  .scene-title { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .scene-sub { font-size: 1rem; }
  .scene-body { flex: none; }
  .scene-body > * { height: auto !important; }
  .l-hero, .l-video, .l-reviews, .l-themes, .l-brand, .l-finance, .l-pattern, .l-turntable, .l-cad, .l-summary, .l-sms { display: flex; flex-direction: column; gap: 1rem; padding: 0; }
  .l-docs { grid-template-columns: 1fr !important; }
  .l-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
  .l-grid .media { aspect-ratio: 4 / 5; }
  .media { min-height: 0; }
  .l-hero .media, .l-video .media, .l-brand .brand-mood .media { height: auto !important; aspect-ratio: 4 / 3; }
  .l-video .media { aspect-ratio: 16 / 9; }
  .l-full .media { height: auto; aspect-ratio: 16 / 9; }
  .l-formats { flex-wrap: wrap; height: auto; gap: .8rem; }
  .l-formats .media { height: auto !important; width: calc(50% - .4rem); }
  .fin-card, .tt-win, .cad-win { overflow: visible; }
  .pat-kpis, .fin-kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .pat-bom { overflow-x: auto; }
  .tt-view { min-height: 0; aspect-ratio: 16 / 10; flex: none; }
  .cad-sheet { flex: none; aspect-ratio: 220 / 150; }
  .cad-tab { font-size: .68rem; }
  .cad-mes { overflow-x: auto; }
  .tt-tools { flex-wrap: wrap; }
  .tt-bar span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  /* Agent */
  .app { grid-template-columns: 1fr; width: 100%; }
  .app-side { display: none; }
  .app-main { padding: 1rem; overflow: visible; }
  .msg-user { max-width: 90%; font-size: .95rem; }
  .msg-ai { max-width: 100%; font-size: .95rem; }
  .step { flex-wrap: wrap; font-size: .86rem; gap: .3rem .5rem; }
  .step .via { font-size: .7rem; }
  .outputs { grid-template-columns: repeat(2, 1fr) !important; height: auto; }
  .outputs .media { aspect-ratio: 4 / 3; }
  /* Divers */
  .job-grid { grid-template-columns: 1fr; }
  .doc.job { overflow: visible; }
  .browser { width: 100%; }
  .shop { grid-template-columns: 1fr; gap: 1rem; padding: 1rem; overflow: visible; }
  .shop-gallery { grid-auto-rows: auto; }
  .shop-gallery .media { aspect-ratio: 1; height: auto !important; }
  .shop-info { overflow: visible; }
  .shop-info h2 { font-size: 1.5rem; }
  .site-nav { padding: .6rem .8rem; flex-wrap: wrap; }
  .site-links { gap: .8rem; font-size: .78rem; }
  .site-hero { flex: none; aspect-ratio: 4 / 3; }
  .site-cards { flex: none; grid-template-columns: repeat(2, 1fr); padding: .8rem; }
  .site-card img { flex: none; aspect-ratio: 1; }
  .fin-bars { flex: none; height: 13rem; gap: .2rem; }
  .fin-bar em, .fin-bar span { font-size: .6rem; }
  .use-cols { flex: none; height: 9rem; }
  .l-video .subtitle { font-size: .8rem; max-width: 92%; }
  .summary-mosaic, .mosaic { grid-template-columns: repeat(4, 1fr) !important; }
  .pat-kpis .kpi, .fin-kpis .kpi { flex-direction: column; align-items: flex-start; gap: .1rem; min-width: 0; }
  .pat-kpis .kpi b { font-size: 1.3rem; }
  .browser-bar { gap: .4rem; }
  .browser-bar i { display: none; }
  .browser-url { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Barre du bas fixe et compacte */
  .genbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; background: var(--bg); padding: .6rem 1rem .8rem; min-height: 4.4rem; grid-template-columns: auto 1fr; gap: .3rem .7rem; }
  .gen-tool { font-size: .78rem; padding: .35rem .65rem; }
  .gen-label { font-size: .85rem; }
  .gen-progress { grid-column: 2; }
  .gen-log { display: none; }
  .chooser.dock { padding: 0 1rem; gap: .6rem; }
  .chooser.dock .chooser-k, .chooser.dock .chooser-hint { display: none; }
  .chooser.dock .chooser-opts { flex: 1; min-width: 0; }
  .chooser.dock button { flex: 1; min-width: 0; justify-content: center; padding: .7rem .6rem; }
  .chooser.dock button b { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; }
  .chooser.dock button span { display: none; }
}
@media (max-width: 900px) and (min-width: 600px) {
  .l-grid { grid-template-columns: repeat(3, 1fr); }
  .l-docs { grid-template-columns: repeat(2, 1fr) !important; }
}
.splash-logos img.logo-faguo { height: 3rem; }
.splash h1 .pi { position: relative; display: inline-block; }
.splash h1 .pi .splash-pulse { position: absolute; left: 50%; top: .1em; width: .15em; height: .15em; transform: translate(-50%, -100%); }
#start { animation: fadein 2s 1.6s ease both, btn-pulse 2.4s 3.6s ease-out infinite !important; }
@keyframes btn-pulse { 0% { box-shadow: 0 0 0 0 rgba(247,139,46,.45); border-color: var(--accent); color: var(--ink); } 70%, 100% { box-shadow: 0 0 0 1.1rem rgba(247,139,46,0); border-color: var(--line); color: var(--ink-2); } }
#start:hover { animation: none !important; }
.sms-link { color: #fff; text-decoration: underline; font-weight: 700; border-radius: 4px; animation: linkGlow 1.8s ease-in-out 1.2s infinite; }
@keyframes linkGlow { 50% { background: rgba(255,255,255,.25); box-shadow: 0 0 0 3px rgba(255,255,255,.25); } }
.cta-big.used, .cta-big:disabled { animation: none; background: var(--panel); color: var(--ink-2); border: 1px solid var(--line); cursor: default; transform: none; }
.cta-hint { color: var(--ink-2); margin: 0; font-size: .95rem; }

/* Lien vers les coulisses, sur le bilan */
.tools .backstage-link { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: .35rem 1.1rem; font-weight: 700; text-decoration: none; }
.tools .backstage-link:hover { filter: brightness(1.08); }

/* ---------- Accueil à la charte Hepix Group (design system V2, mode encre) ---------- */
.splash {
  --hx-encre: #23262B; --hx-texte: #CDD2D8; --hx-second: #9AA0A8; --hx-mono: #AEB4BC; --hx-filet: #454A52; --hx-etiquette: #2D3137; --hx-orange: #F78B2E;
  --hx-sora: "Sora", var(--font); --hx-mono-f: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  background-color: var(--hx-encre);
  background-image: radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1.2px);
  background-size: 22px 22px; background-position: 11px 11px;
}
.splash::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, transparent 0, var(--hx-encre) 72%); pointer-events: none; }
.splash-inner, .splash-logos { position: relative; }
.splash-rub, .splash-date { font-family: var(--hx-mono-f); font-weight: 500; text-transform: uppercase; color: var(--hx-mono); letter-spacing: .22em; font-size: .85rem; margin: 0; }
.splash-rub { animation: fadein 2s .2s ease both; }
.splash h1 { font-family: var(--hx-sora); font-weight: 500; color: #fff; letter-spacing: -.04em; font-size: clamp(4rem, 11vw, 9rem); margin: .25em 0 0; }
.splash h1 .pt { color: var(--hx-orange); }
.splash-bar { display: block; width: 46px; height: 2px; background: var(--hx-orange); margin: 1.6rem auto 0; animation: fadein 2s .6s ease both; }
.splash-date { margin-top: 1.4rem; color: var(--hx-texte); }
.splash button#start { font-family: var(--hx-mono-f); font-weight: 500; border-radius: 0; color: var(--hx-texte); border-color: var(--hx-filet); letter-spacing: .3em; }
.splash button#start:hover { background: #fff; color: var(--hx-encre); border-color: #fff; }
#start { animation: fadein 2s 1.6s ease both, hx-pulse 2.4s 3.6s ease-out infinite !important; }
@keyframes hx-pulse { 0% { box-shadow: 0 0 0 0 rgba(247,139,46,.5); border-color: var(--hx-orange); color: #fff; } 70%, 100% { box-shadow: 0 0 0 1.1rem rgba(247,139,46,0); border-color: var(--hx-filet); color: var(--hx-texte); } }
.splash-x { color: var(--hx-second); font-family: var(--hx-mono-f); }

/* =========================================================
   Charte Hepix Group, mode encre, sur tout le parcours
   (design system V2 : encre, crème, orange en touche, Sora, IBM Plex Mono, trame de points)
   ========================================================= */
:root {
  --bg: #23262B; --bg-2: #1E2125; --panel: #2D3137; --line: #454A52;
  --ink: #F4F5F7; --ink-2: #CDD2D8; --ink-3: #9AA0A8;
  --accent: #F78B2E; --accent-ink: #23262B; --warm: #F0B26B;
  --display: "Sora", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
#app { background-color: var(--bg); background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1.2px); background-size: 22px 22px; background-position: 11px 11px; }
.brand { font-family: var(--display); font-weight: 500; }
.brand .dot { border-radius: 0; width: .55rem; height: .55rem; box-shadow: none; }
.counter-num { font-family: var(--display); font-weight: 500; }
.counter-label, .rail li .num, .scene-num, .gen-tool, .gen-log { font-family: var(--mono); }
.scene-num { font-weight: 500; letter-spacing: .18em; }
.scene-title { font-family: var(--display); font-weight: 500; letter-spacing: -.02em; }
.rail li::before { border-radius: 0; transform: rotate(45deg) scale(.85); }
.rail li.current::before { box-shadow: none; }
.big b, .bigs b { font-family: var(--display); font-weight: 500; }
/* Pas d'aplat orange pour les boutons : blanc sur encre, la touche orange au survol */
.cta-big, .chooser button.primary, .tools .backstage-link { background: #fff; color: var(--accent-ink); border-color: #fff; }
.cta-big:hover, .chooser button.primary:hover, .tools .backstage-link:hover { box-shadow: 0 0 0 3px var(--accent); }
.chooser-timer i { background: var(--accent); opacity: 1; }
.scene-num { white-space: nowrap; }
.sms-link2 { color: #fff; text-decoration: underline; font-weight: 700; }
@media (min-width: 901px) { .phone.wide { aspect-ratio: 10 / 16; } }
@media (min-width: 901px) { .phone.wide .sms-head .avatar { display: none; } .phone.wide .sms-thread { gap: .35rem; } }
.phone.wide .sms-thread { overflow-y: auto; scrollbar-width: none; justify-content: flex-start; }
.phone.wide .sms-thread > :first-child { margin-top: auto; }
