:root {
  --bg: #070504;
  --glass: rgba(24, 17, 12, 0.55);
  --glass-2: rgba(34, 24, 17, 0.62);
  --glass-hi: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f6efe9;
  --soft: #d6c8bc;
  --muted: #9a8a7d;
  --violet: #ff7a1a;
  --indigo: #ff8c2e;
  --cyan: #ffc14d;
  --pink: #ff5a1f;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --grad: linear-gradient(135deg, #ffc163 0%, #ff7a1a 45%, #ff3d00 100%);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); overflow: hidden; font-size: 15px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; position: relative; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.defs { position: absolute; width: 0; height: 0; }
.grad-text { background: var(--grad); background-size: 200% 200%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradShift 6s ease-in-out infinite; }
code { font-family: "Cascadia Code", Consolas, monospace; }

/* ================================================================ fond animé */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.b1 { width: 620px; height: 620px; left: -160px; top: -220px; background: #c2410c; animation: drift1 26s ease-in-out infinite; }
.b2 { width: 560px; height: 560px; right: -180px; bottom: -220px; background: #7c2d12; opacity: .38; animation: drift2 30s ease-in-out infinite; }
.b3 { width: 420px; height: 420px; left: 45%; top: 40%; background: #ea580c; opacity: .16; animation: drift3 34s ease-in-out infinite; }
body.busy .b1 { animation-duration: 9s; opacity: .62; }
body.busy .b2 { animation-duration: 11s; opacity: .5; }
.grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  animation: gridMove 40s linear infinite;
}
@keyframes drift1 { 50% { transform: translate(120px, 90px) scale(1.12); } }
@keyframes drift2 { 50% { transform: translate(-110px, -70px) scale(1.08); } }
@keyframes drift3 { 50% { transform: translate(-180px, 60px) scale(.9); } }
@keyframes gridMove { to { background-position: 48px 48px; } }

.app { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }

/* ================================================================ logo : anneau ouvert + lune + cœur */
.nova-logo { width: 40px; height: 40px; position: relative; flex: none; }
.nova-logo svg { width: 100%; height: 100%; overflow: visible; }
.nova-logo .aura { fill: url(#ng-aura); stroke: none; transform-origin: 50px 50px; animation: breathe 4.5s ease-in-out infinite; }
.nova-logo .orbit-line { fill: none; stroke: rgba(255, 160, 64, .28); stroke-width: 1.4; stroke-dasharray: 2 5; transform-origin: 50px 50px; animation: spin 60s linear infinite; }
.nova-logo .spin { transform-origin: 50px 50px; animation: rock 6s ease-in-out infinite; }
.nova-logo .ring { fill: none; stroke: url(#ng-ring); stroke-width: 11; stroke-linecap: round; }
.nova-logo .moon { fill: url(#ng-moon); stroke: none; filter: drop-shadow(0 0 3px rgba(255, 190, 110, .9)); transform-origin: 74px 32px; animation: moonGlow 3s ease-in-out infinite; }
.nova-logo .core { fill: url(#ng-core); stroke: none; transform-origin: 50px 50px; animation: corePulse 4s ease-in-out infinite; }
.nova-logo .orbit { transform-origin: 50px 50px; opacity: 0; transition: opacity .4s; }
.nova-logo .orbit circle { fill: #ffe0a8; stroke: none; }
.nova-logo .voice circle { fill: none; stroke: #ff8a1f; stroke-width: 2; opacity: 0; transform-origin: 50px 50px; }

/* Apparition : l'anneau se dessine, la lune arrive */
.nova-logo.intro .ring { animation: ringDraw 1.2s var(--ease) both; }
.nova-logo.intro .moon { animation: moonIn .7s 1s var(--spring) both, moonGlow 3s 1.7s ease-in-out infinite; }
.nova-logo.intro .core { animation: popCore .6s .3s var(--spring) both, corePulse 4s .9s ease-in-out infinite; }

/* En train de réfléchir : l'anneau et sa lune tournent, le cœur bat */
.nova-logo.thinking .spin { animation: spin 1.3s cubic-bezier(.5, .1, .5, .9) infinite; }
.nova-logo.thinking .core { animation: coreThink 1s ease-in-out infinite; }
.nova-logo.thinking .orbit { opacity: 1; animation: spinRev 2.2s linear infinite; }
.nova-logo.thinking .orbit-line { animation-duration: 6s; stroke: rgba(255, 190, 110, .55); }
.nova-logo.thinking::after {
  content: ""; position: absolute; inset: -30%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 26, .4), transparent 65%);
  animation: glow 1.4s ease-in-out infinite; z-index: -1;
}
/* En train de parler : ondes */
.nova-logo.speaking .voice circle { animation: wave 1.6s ease-out infinite; }
.nova-logo.speaking .voice circle:nth-child(2) { animation-delay: .8s; }
.nova-logo.speaking .core { animation: coreThink .45s ease-in-out infinite alternate; }
.nova-logo.big { width: 116px; height: 116px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinRev { to { transform: rotate(-360deg); } }
@keyframes rock { 50% { transform: rotate(-14deg); } }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .75; } }
@keyframes glow { 50% { opacity: .35; transform: scale(1.15); } }
@keyframes ringDraw { from { stroke-dasharray: 0 188.5; } to { stroke-dasharray: 150 38.5; } }
@keyframes moonIn { from { transform: scale(0); opacity: 0; } }
@keyframes moonGlow { 50% { transform: scale(1.18); } }
@keyframes corePulse { 50% { transform: scale(1.12); } }
@keyframes coreThink { 0%, 100% { transform: scale(.8); } 50% { transform: scale(1.3); } }
@keyframes popCore { from { transform: scale(0); } }
@keyframes wave { from { r: 30; opacity: .75; } to { r: 58; opacity: 0; } }
@keyframes gradShift { 50% { background-position: 100% 50%; } }

/* ================================================================ barre du haut */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: linear-gradient(rgba(10, 7, 5, .65), rgba(10, 7, 5, .35));
  backdrop-filter: blur(22px) saturate(140%);
  animation: slideDown .6s var(--ease) both;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-text .name { font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif; font-weight: 700; font-size: 19px; letter-spacing: .3px; }
.status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); transition: color .3s; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: softPulse 2.4s ease-in-out infinite; }
.status.working { color: #ffe0a8; }
.status.working i { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink .8s infinite; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); color: var(--soft); background: var(--glass-hi); transition: all .2s var(--ease);
}
.icon-btn:hover { color: #fff; border-color: var(--line-2); background: rgba(255,255,255,.08); transform: translateY(-2px); }
.icon-btn:hover svg { animation: iconPop .4s var(--spring); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.active { color: #fff; border-color: rgba(255, 160, 64, .5); background: rgba(255, 122, 26, .18); box-shadow: 0 0 18px rgba(255, 122, 26, .25); }
.icon-btn.danger:hover { color: var(--red); border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .08); }
#voiceBtn .spk-on { display: none; } #voiceBtn.active .spk-on { display: block; } #voiceBtn.active .spk-off { display: none; }
#memoryBtn { overflow: visible; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 12px rgba(255, 160, 64, .6); animation: badgeIn .5s var(--spring); }
#memoryBtn.learn { animation: learnGlow 1.2s ease-out; }
.chip {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--glass-2); font-size: 13px; transition: all .2s var(--ease);
}
.chip:hover { border-color: rgba(255, 160, 64, .55); transform: translateY(-1px); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: softPulse 2.4s ease-in-out infinite; }
.chip.off .dot { background: var(--red); box-shadow: 0 0 10px var(--red); }

/* Interrupteur « Accès au PC » */
.access {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 10px 0 8px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--glass-2); transition: all .3s var(--ease);
}
.access:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.2); }
.access-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(248, 113, 113, .12); color: var(--red); transition: all .3s; }
.access-icon svg { width: 18px; height: 18px; }
.access .lock-open { display: none; }
.access-text { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.access-text b { font-size: 13.5px; font-weight: 600; }
.access-text small { font-size: 11.5px; color: var(--red); transition: color .3s; }
.mini-switch { width: 38px; height: 22px; border-radius: 999px; background: #3a2c22; position: relative; transition: background .3s; margin-left: 4px; }
.mini-switch span { position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.access.on { border-color: rgba(52, 211, 153, .4); box-shadow: 0 0 0 4px rgba(52, 211, 153, .06), 0 8px 30px rgba(52, 211, 153, .08); }
.access.on .access-icon { background: rgba(52, 211, 153, .14); color: var(--green); animation: unlock .5s var(--spring); }
.access.on .lock-open { display: block; } .access.on .lock-closed { display: none; }
.access.on .access-text small { color: var(--green); }
.access.on .mini-switch { background: linear-gradient(135deg, #10b981, #ffc14d); }
.access.on .mini-switch span { transform: translateX(16px); }

/* ================================================================ zone principale */
.workspace { flex: 1; min-height: 0; display: flex; position: relative; }
.chat { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; padding: 10px 22px 20px; }
.scroll { flex: 1; overflow-y: auto; padding: 8px 6px 24px; scroll-behavior: smooth; }
.scroll > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.scroll::-webkit-scrollbar, .drawer-panel::-webkit-scrollbar, .trace-body::-webkit-scrollbar { width: 10px; }
.scroll::-webkit-scrollbar-thumb, .drawer-panel::-webkit-scrollbar-thumb, .trace-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* Accueil */
.hero { text-align: center; padding-top: 4vh; }
.hero-logo { display: inline-grid; place-items: center; width: 176px; height: 176px; border-radius: 50%; position: relative; animation: floatY 6s ease-in-out infinite; }
.hero-logo::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255, 160, 64, .24), transparent 68%); animation: breathe 5s ease-in-out infinite; }
.hero-logo::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px dashed rgba(255, 160, 64, .25); animation: spin 30s linear infinite; }
.hero h1 { font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif; font-size: 40px; font-weight: 650; letter-spacing: -.5px; margin: 8px 0 10px; }
.hero p { color: var(--soft); font-size: 16px; margin: 0 0 34px; }
.anim-in { animation: rise .7s var(--d, 0s) var(--ease) both; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.card-btn {
  display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px);
  transition: all .25s var(--ease); position: relative; overflow: hidden; text-align: left;
}
.card-btn::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 160, 64, .16), transparent 45%); opacity: 0; transition: opacity .25s; }
.card-btn:hover { transform: translateY(-4px) scale(1.01); border-color: rgba(255, 160, 64, .38); box-shadow: 0 16px 44px rgba(0, 0, 0, .4); }
.card-btn:hover::before { opacity: 1; }
.card-btn:hover .cb-icon { transform: rotate(-8deg) scale(1.12); }
.card-btn b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.card-btn small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.cb-icon, .pi { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; transition: transform .35s var(--spring); }
.c1 { background: rgba(255, 122, 26, .15); color: #ffc38a; }
.c2 { background: rgba(255, 193, 77, .13); color: #ffcf7a; }
.c3 { background: rgba(255, 90, 31, .13); color: #ffe2c2; }
.c4 { background: rgba(52, 211, 153, .13); color: #6ee7b7; }

/* Messages */
.msg { display: flex; gap: 12px; margin-bottom: 20px; }
.msg.user { justify-content: flex-end; animation: inRight .45s var(--spring) both; }
.msg.ai { animation: inLeft .45s var(--ease) both; }
.msg.restored { animation: fade .3s both; }
.msg .who { font-size: 12px; font-weight: 600; color: var(--muted); margin: 2px 0 6px; letter-spacing: .3px; }
.msg > .nova-logo { width: 34px; height: 34px; margin-top: 2px; }
.body { min-width: 0; max-width: 84%; }
.text { line-height: 1.65; word-wrap: break-word; color: #f1e8e0; }
.text p { margin: 0 0 8px; } .text p:last-child { margin-bottom: 0; }
.text ul, .text ol { margin: 4px 0 8px; padding-left: 22px; }
.text li { margin: 2px 0; }
.text h4 { margin: 10px 0 6px; font-size: 15.5px; }
.msg.user .text {
  background: var(--grad); background-size: 160% 160%; color: #fff; padding: 11px 17px; border-radius: 20px 20px 6px 20px; white-space: pre-wrap;
  box-shadow: 0 10px 30px rgba(255, 140, 46, .28), inset 0 1px 0 rgba(255,255,255,.25); animation: gradShift 8s ease-in-out infinite;
}
.msg.user .files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.msg.user .files a { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--line-2); color: var(--soft); font-size: 12.5px; text-decoration: none; }
.msg.user .files img { max-width: 220px; max-height: 160px; border-radius: 12px; border: 1px solid var(--line-2); display: block; }
.msg.ai .text { padding: 2px 0; }
.msg.note .text { color: var(--muted); font-size: 13.5px; font-style: italic; }
.inline-allow { display: block; margin-top: 10px; font-style: normal; }
.msg.error .text { background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .3); color: #fecaca; padding: 10px 14px; border-radius: 14px; animation: shake .5s; }
.text a { color: #ffcf7a; }
.text code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.text pre { background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; overflow: auto; margin: 8px 0; position: relative; }
.text pre code { background: none; padding: 0; font-size: 12.8px; line-height: 1.5; white-space: pre; }
.text pre .copy-code { position: absolute; top: 6px; right: 6px; font-size: 11.5px; padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.07); color: var(--soft); opacity: 0; transition: opacity .2s; }
.text pre:hover .copy-code { opacity: 1; }
.caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 3px; vertical-align: -2px; border-radius: 2px; background: var(--grad); animation: blink .9s infinite; }
.word { animation: wordIn .35s var(--ease) both; }
.msg.speaking .text { text-shadow: 0 0 18px rgba(255, 160, 64, .35); }

/* Petits boutons sous une réponse */
.msg-actions { display: flex; gap: 4px; margin-top: 8px; opacity: 0; transform: translateY(-4px); transition: all .25s var(--ease); }
.msg.ai:hover .msg-actions, .msg-actions.keep { opacity: 1; transform: none; }
.msg-actions button { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); transition: all .2s var(--spring); }
.msg-actions button:hover { color: #fff; background: rgba(255,255,255,.07); transform: scale(1.12); }
.msg-actions button.on { color: #ffc38a; background: rgba(255, 122, 26, .16); }
.msg-actions button.good.on { color: var(--green); background: rgba(52, 211, 153, .14); animation: pop .4s var(--spring); }
.msg-actions button.bad.on { color: var(--amber); background: rgba(251, 191, 36, .12); animation: pop .4s var(--spring); }
.msg-actions svg { width: 16px; height: 16px; }
.fb-box { display: flex; gap: 8px; margin-top: 8px; animation: rise .3s var(--ease); }
.fb-box input { flex: 1; height: 38px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(0,0,0,.3); color: var(--text); padding: 0 12px; font: inherit; font-size: 13.5px; outline: none; }
.fb-box input:focus { border-color: rgba(255, 160, 64, .6); }

/* Nova réfléchit (indicateur) */
.thinking-row { align-items: center; gap: 16px; animation: fade .3s both; }
.thinking-row .nova-logo { width: 54px; height: 54px; margin: 0; }
.think-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shimmer {
  font-weight: 600; font-size: 15.5px;
  background: linear-gradient(90deg, #9a8a7d 0%, #fff3e6 40%, #ffe0a8 50%, #9a8a7d 70%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2s linear infinite;
}
.think-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; animation: fade .3s; }
.dots i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); margin-left: 3px; animation: dotJump 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }

/* Carte de réflexion : ce à quoi Nova pense et ce qu'elle fait, en direct */
.trace { margin: 0 0 18px; margin-left: max(46px, calc((100% - 820px) / 2 + 46px)); margin-right: max(0px, calc((100% - 820px) / 2)); max-width: none !important; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); overflow: hidden; animation: traceIn .5s var(--spring) both; position: relative; }
.trace.live { border-color: rgba(255, 160, 64, .35); box-shadow: 0 0 0 1px rgba(255, 160, 64, .08), 0 10px 40px rgba(255, 106, 0, .12); }
.trace.live::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, #ffa040, #ffc14d, transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: scan 1.6s linear infinite; }
.trace-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; text-align: left; }
.trace-head .nova-logo { width: 22px; height: 22px; }
.trace-head .tt { font-weight: 600; font-size: 13.5px; }
.trace-head .tmeta { font-size: 12px; color: var(--muted); margin-left: auto; }
.trace-head .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .3s var(--ease); }
.trace.open .chev { transform: rotate(180deg); }
.trace-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.trace.open .trace-body { grid-template-rows: 1fr; }
.trace-inner { overflow: hidden; min-height: 0; }
.trace-inner > div { padding: 0 16px 14px; max-height: 380px; overflow-y: auto; }
.reflect { font-size: 13.3px; line-height: 1.6; color: #e2d4c8; white-space: pre-wrap; border-left: 2px solid rgba(255, 160, 64, .45); padding: 2px 0 2px 12px; margin: 2px 0 12px; animation: fade .4s; }
.reflect .caret { height: .95em; width: 6px; }
.tsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tstep { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; animation: stepIn .45s var(--spring) both; cursor: pointer; }
.tstep .ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--soft); position: relative; transition: all .3s; }
.tstep .ic svg { width: 14px; height: 14px; }
.tstep .t { font-size: 13px; font-weight: 600; display: flex; gap: 8px; justify-content: space-between; padding-top: 4px; }
.tstep .t em { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.tstep .d { font-size: 12.3px; color: var(--muted); word-break: break-word; }
.tstep .r { font-size: 12px; color: #c2b2a4; white-space: pre-wrap; max-height: 0; overflow: hidden; transition: max-height .35s var(--ease), margin .3s; font-family: "Cascadia Code", Consolas, monospace; }
.tstep.open .r { max-height: 240px; overflow-y: auto; margin-top: 6px; }
.tstep img { width: 100%; max-width: 420px; border-radius: 9px; margin-top: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.tstep.running .ic { color: #ffe0a8; border-color: rgba(255, 193, 77, .5); box-shadow: 0 0 16px rgba(255, 193, 77, .25); }
.tstep.running .ic::after { content: ""; position: absolute; inset: -4px; border-radius: 12px; border: 2px solid transparent; border-top-color: var(--cyan); animation: spin .8s linear infinite; }
.tstep.waiting .ic { color: var(--amber); border-color: rgba(251, 191, 36, .5); animation: softPulse 1s infinite; }
.tstep.done .ic { color: var(--green); background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .3); animation: pop .45s var(--spring); }
.tstep.error .ic { color: var(--red); background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .3); animation: shake .45s; }

/* Zone de saisie */
.composer-wrap { padding: 4px 6px 0; }
.composer-wrap > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.attachments:empty { display: none; }
.att { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line-2); font-size: 12.8px; max-width: 260px; animation: popIn .4s var(--spring) both; }
.att .thumb { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 122, 26, .16); color: #ffc38a; flex: none; overflow: hidden; }
.att .thumb img { width: 100%; height: 100%; object-fit: cover; }
.att .thumb svg { width: 16px; height: 16px; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att small { color: var(--muted); display: block; font-size: 11px; }
.att button { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); flex: none; }
.att button:hover { color: #fff; background: rgba(255,255,255,.08); }
.att button svg { width: 13px; height: 13px; }
.att.loading .thumb::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--cyan); animation: spin .7s linear infinite; }
.att.loading .thumb { position: relative; }
.att.loading .thumb svg { opacity: .3; }
.composer {
  display: flex; align-items: flex-end; gap: 6px; padding: 8px; border-radius: 22px; position: relative;
  background: rgba(18, 13, 10, .72); border: 1px solid var(--line-2); backdrop-filter: blur(24px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45); transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
  animation: rise .7s .2s var(--ease) both;
}
.composer::before {
  content: ""; position: absolute; inset: -1px; border-radius: 23px; padding: 1.5px;
  background: conic-gradient(from var(--ang, 0deg), #ffd166, #ff7a1a, #ff3d00, #ffb347, #ffd166);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s; pointer-events: none; animation: angle 4s linear infinite;
}
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes angle { to { --ang: 360deg; } }
.composer:focus-within::before, body.busy .composer::before { opacity: 1; }
.composer:focus-within { box-shadow: 0 20px 60px rgba(0, 0, 0, .45), 0 0 44px rgba(255, 122, 26, .2); }
.composer.sent { animation: sentBump .45s var(--spring); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 15.5px; padding: 11px 6px; max-height: 170px; line-height: 1.45; }
.composer textarea::placeholder { color: #6e5f54; }
.c-btn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; transition: all .2s var(--ease); overflow: hidden; }
.mic, .attach { color: var(--muted); }
.mic:hover, .attach:hover { color: #fff; background: rgba(255,255,255,.06); }
.attach:hover svg { animation: wiggle .5s; }
.mic.listening { color: #fff; background: var(--red); animation: pulse 1.2s infinite; }
.send { background: var(--grad); background-size: 200% 200%; color: #fff; box-shadow: 0 6px 20px rgba(255, 140, 46, .35); animation: gradShift 5s ease-in-out infinite; }
.send:hover { transform: translateY(-2px) scale(1.06); filter: brightness(1.12); }
.send.fly svg { animation: fly .5s var(--ease); }
.stop { background: rgba(248, 113, 113, .14); color: var(--red); border: 1px solid rgba(248, 113, 113, .4); animation: popIn .35s var(--spring); }
.stop:hover { background: rgba(248, 113, 113, .22); }
.hint-line { text-align: center; font-size: 12px; color: var(--muted); padding: 9px 0 0; }
.hint-line b { color: var(--soft); font-weight: 600; }
.hint-line button { color: #ffc38a; text-decoration: underline; text-underline-offset: 3px; }

/* Glisser-déposer */
.dropzone { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(4, 5, 11, .7); backdrop-filter: blur(8px); animation: fade .2s; }
.drop-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 46px 70px; border-radius: 28px; border: 2px dashed rgba(255, 160, 64, .6); background: rgba(255, 122, 26, .08); animation: pop .35s var(--spring); }
.drop-card svg { width: 46px; height: 46px; color: #ffc38a; animation: floatY 1.6s ease-in-out infinite; }
.drop-card b { font-size: 19px; } .drop-card small { color: var(--muted); }

/* Effet d'onde au clic */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.35); animation: ripple .6s ease-out; pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ================================================================ fenêtres */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(6, 4, 2, .62); backdrop-filter: blur(10px); animation: fade .2s; }
.sheet {
  position: relative; width: min(500px, 92vw); padding: 30px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(36, 26, 18, .96), rgba(20, 14, 10, .96)); border: 1px solid var(--line-2);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255,255,255,.06); animation: pop .4s var(--spring);
}
.sheet h2 { font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif; font-size: 22px; margin: 14px 0 6px; text-align: center; }
.access-sheet { width: min(540px, 94vw); text-align: center; }
.access-sheet .nova-logo { margin: 0 auto; width: 84px; height: 84px; }
.lead { color: var(--soft); margin: 0 0 16px; }
.perm-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; text-align: left; }
.perm-list li { display: flex; gap: 14px; align-items: center; padding: 11px 13px; border-radius: 15px; background: rgba(255,255,255,.035); border: 1px solid var(--line); animation: rise .45s var(--ease) both; }
.perm-list li:nth-child(2) { animation-delay: .06s; } .perm-list li:nth-child(3) { animation-delay: .12s; } .perm-list li:nth-child(4) { animation-delay: .18s; }
.perm-list b { display: block; font-size: 14px; }
.perm-list small { color: var(--muted); font-size: 12.5px; }
.perm-list .pi { width: 38px; height: 38px; border-radius: 12px; }
.perm-list .pi svg { width: 18px; height: 18px; }
.reassure { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 12.8px; color: #a7f3d0; background: rgba(52, 211, 153, .07); border: 1px solid rgba(52, 211, 153, .22); padding: 11px 13px; border-radius: 14px; line-height: 1.45; }
.reassure svg { color: var(--green); width: 19px; height: 19px; margin-top: 1px; }
.confirm { text-align: center; }
.warn-icon { width: 58px; height: 58px; border-radius: 18px; margin: 0 auto; display: grid; place-items: center; color: #1a1300; background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 0 40px rgba(251, 191, 36, .35); animation: wiggle .6s .2s; }
.warn-icon svg { width: 28px; height: 28px; stroke-width: 2.3; }
.confirm p { color: #e6dbd0; margin: 0 0 12px; }
.confirm pre { text-align: left; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; font-size: 12.5px; color: var(--soft); max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-family: "Cascadia Code", Consolas, monospace; margin: 0; }
.row { display: flex; gap: 10px; margin-top: 20px; }
.row .btn { flex: 1; }
.btn { height: 46px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,.05); font-weight: 600; transition: all .2s var(--ease); overflow: hidden; }
.btn:hover { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); background-size: 200% 200%; border: 0; color: #fff; box-shadow: 0 10px 30px rgba(255, 140, 46, .35); animation: gradShift 6s ease-in-out infinite; }
.btn.primary:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn.small { height: 40px; padding: 0 14px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 26px; }
.danger-text { color: var(--red); }
.danger-text:hover { border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .08); }

.drawer { position: fixed; inset: 0; z-index: 15; background: rgba(6, 4, 2, .5); backdrop-filter: blur(6px); animation: fade .2s; }
.drawer-panel { position: absolute; right: 12px; top: 12px; bottom: 12px; width: min(460px, 96vw); background: linear-gradient(180deg, rgba(30, 21, 15, .97), rgba(18, 13, 10, .97)); border: 1px solid var(--line-2); border-radius: 24px; padding: 24px 26px; overflow-y: auto; animation: slide .45s var(--spring); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer h2 { margin: 0; font-size: 21px; font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif; }
.drawer h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 26px 0 12px; }
.drawer label { display: block; font-size: 13px; color: #ddd0c4; margin: 14px 0 6px; }
.drawer input:not([type=checkbox]):not([type=range]), .drawer select { width: 100%; height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.3); color: var(--text); font: inherit; font-size: 14px; outline: none; transition: border-color .2s; }
.drawer input[type=range] { width: 100%; accent-color: #ffa040; }
.drawer select option { background: #1a120c; }
.drawer input:focus, .drawer select:focus { border-color: rgba(255, 160, 64, .6); }
.inline { display: flex; gap: 8px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.hint code { background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 5px; }
.hint.ok { color: var(--green); } .hint.bad { color: var(--amber); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { padding: 13px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); text-align: left; display: flex; flex-direction: column; gap: 2px; transition: all .25s var(--ease); overflow: hidden; }
.seg button:hover { transform: translateY(-1px); }
.seg button small { color: var(--muted); font-size: 12px; }
.seg button.on { background: linear-gradient(rgba(28,20,14,1), rgba(28,20,14,1)) padding-box, var(--grad) border-box; border: 1px solid transparent; box-shadow: 0 0 24px rgba(255, 122, 26, .2); }
.box { margin-top: 6px; }
.switch { display: flex !important; align-items: center; gap: 12px; cursor: pointer; }
.switch input { display: none; }
.switch > span { width: 42px; height: 24px; border-radius: 999px; background: #3a2c22; position: relative; transition: background .3s; flex: none; }
.switch > span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring); }
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { transform: translateX(18px); }
.big-switch { align-items: flex-start !important; padding: 13px; border-radius: 15px; background: rgba(255,255,255,.035); border: 1px solid var(--line); margin: 0 !important; }
.big-switch b { display: block; color: var(--text); font-size: 14px; }
.big-switch small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.progress { margin-top: 10px; height: 28px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid var(--line); position: relative; overflow: hidden; }
.progress div { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--grad); opacity: .45; transition: width .3s; }
.progress span { position: relative; font-size: 12px; line-height: 26px; padding-left: 10px; }

/* Mémoire */
.mem-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.mem-stats div { padding: 10px 8px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid var(--line); text-align: center; animation: popIn .45s var(--spring) both; }
.mem-stats b { display: block; font-size: 20px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mem-stats small { font-size: 11.5px; color: var(--muted); }
.mem-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 13px; background: rgba(255,255,255,.03); border: 1px solid var(--line); margin-bottom: 7px; font-size: 13.4px; line-height: 1.45; animation: rise .35s var(--ease) both; transition: all .3s var(--ease); }
.mem-item:hover { border-color: var(--line-2); background: rgba(255,255,255,.05); }
.mem-item span { flex: 1; }
.mem-item small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.mem-item button { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); opacity: 0; transition: all .2s; flex: none; }
.mem-item:hover button { opacity: 1; }
.mem-item button:hover { color: var(--red); background: rgba(248, 113, 113, .1); }
.mem-item button svg { width: 14px; height: 14px; }
.mem-item.out { opacity: 0; transform: translateX(30px); }
.mem-empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }

/* Notifications */
.toasts { position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: rgba(38, 27, 19, .95); border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 14px; font-size: 14px; animation: toastIn .5s var(--spring) both; box-shadow: 0 16px 40px rgba(0,0,0,.4); backdrop-filter: blur(12px); display: flex; gap: 10px; align-items: center; max-width: 560px; }
.toast.mem { border-color: rgba(255, 160, 64, .45); box-shadow: 0 16px 40px rgba(0,0,0,.4), 0 0 30px rgba(255, 122, 26, .22); }
.toast.mem svg { color: #ffc38a; animation: iconPop .6s var(--spring); }
.toast.out { animation: toastOut .4s var(--ease) forwards; }

@keyframes blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes softPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.94); } }
@keyframes popIn { from { opacity: 0; transform: scale(.6); } }
@keyframes slide { from { transform: translateX(60px); opacity: 0; } }
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } }
@keyframes inRight { from { opacity: 0; transform: translateX(40px) scale(.92); } }
@keyframes inLeft { from { opacity: 0; transform: translateX(-24px); } }
@keyframes traceIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes stepIn { from { opacity: 0; transform: translateX(-14px); } }
@keyframes wordIn { from { opacity: 0; filter: blur(4px); } }
@keyframes scan { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, .5); } 50% { box-shadow: 0 0 0 9px rgba(248, 113, 113, 0); } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@keyframes wiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes iconPop { 50% { transform: scale(1.25); } }
@keyframes unlock { 50% { transform: rotate(-14deg) scale(1.15); } }
@keyframes floatY { 50% { transform: translateY(-8px); } }
@keyframes dotJump { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes sentBump { 40% { transform: scale(.985); } }
@keyframes fly { 50% { transform: translateY(-26px); opacity: 0; } 51% { transform: translateY(26px); } }
@keyframes badgeIn { from { transform: scale(0); } }
@keyframes learnGlow { 0% { box-shadow: 0 0 0 0 rgba(255, 160, 64, .7); } 100% { box-shadow: 0 0 0 16px rgba(255, 160, 64, 0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.95); } }

@media (max-width: 1000px) { .access-text small { display: none; } }
@media (max-width: 760px) {
  .topbar { grid-template-columns: auto 1fr; }
  .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .cards { grid-template-columns: 1fr; }
  .trace { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================================================================ panneau de gauche : projets et conversations */
.sidebar { width: 272px; flex: none; display: flex; flex-direction: column; gap: 10px; padding: 14px 12px 12px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(14, 10, 7, .72), rgba(10, 7, 5, .55)); backdrop-filter: blur(22px); transition: margin-left .4s var(--ease), opacity .3s; animation: slideRight .55s var(--ease) both; z-index: 2; }
body.sb-closed .sidebar { margin-left: -272px; opacity: 0; pointer-events: none; }
#sbToggle { width: 36px; height: 36px; }
.new-conv { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 13px; font-weight: 600; font-size: 14px; color: #fff; background: var(--grad); background-size: 200% 200%; box-shadow: 0 8px 24px rgba(255, 140, 46, .3); transition: transform .2s var(--ease), filter .2s; overflow: hidden; animation: gradShift 6s ease-in-out infinite; }
.new-conv:hover { transform: translateY(-2px); filter: brightness(1.1); }
.new-conv svg { width: 17px; height: 17px; }
.sb-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 11px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted); transition: border-color .2s; }
.sb-search:focus-within { border-color: rgba(255, 160, 64, .5); }
.sb-search svg { width: 15px; height: 15px; }
.sb-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 13px; }
.sb-scroll { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.sb-scroll::-webkit-scrollbar { width: 8px; } .sb-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.07); border-radius: 8px; }
.sb-section { display: flex; align-items: center; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--muted); margin: 14px 6px 6px; }
.sb-section button { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); transition: all .2s var(--spring); }
.sb-section button:hover { color: #fff; background: rgba(255,255,255,.08); transform: rotate(90deg); }
.sb-section button svg { width: 15px; height: 15px; }
.sb-proj { margin-bottom: 2px; animation: rise .35s var(--ease) both; }
.sb-proj-head { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; transition: background .2s; }
.sb-proj-head:hover, .sb-proj-head.drag-over { background: rgba(255,255,255,.06); }
.sb-proj-head.drag-over { box-shadow: inset 0 0 0 1.5px rgba(255, 160, 64, .7); }
.sb-proj-head .chev { width: 14px; height: 14px; color: var(--muted); transition: transform .25s var(--ease); transform: rotate(-90deg); }
.sb-proj.open .sb-proj-head .chev { transform: none; }
.sb-proj-head .folder { width: 17px; height: 17px; color: var(--pc, #ffa040); }
.sb-proj-head .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-proj-head .count { font-size: 11px; color: var(--muted); font-weight: 500; }
.sb-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.sb-proj-head:hover .sb-acts, .sb-conv:hover .sb-acts, .sb-conv.active .sb-acts { opacity: 1; }
.sb-acts button { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.sb-acts button:hover { color: #fff; background: rgba(255,255,255,.1); }
.sb-acts button.del:hover { color: var(--red); }
.sb-acts svg { width: 13px; height: 13px; }
.sb-proj-convs { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); padding-left: 14px; }
.sb-proj.open .sb-proj-convs { grid-template-rows: 1fr; }
.sb-proj-convs > div { overflow: hidden; min-height: 0; border-left: 1px solid var(--line); padding-left: 6px; }
.sb-empty { font-size: 12px; color: #6e5f54; padding: 6px 8px; }
.sb-conv { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 9px; font-size: 13px; color: var(--soft); cursor: pointer; transition: all .2s var(--ease); animation: fade .3s both; }
.sb-conv:hover { background: rgba(255,255,255,.05); color: #fff; transform: translateX(2px); }
.sb-conv.active { background: rgba(255, 122, 26, .16); color: #fff; box-shadow: inset 2px 0 0 #ffa040; }
.sb-conv.dragging { opacity: .4; }
.sb-conv .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-conv input { flex: 1; min-width: 0; background: rgba(0,0,0,.4); border: 1px solid rgba(255, 160, 64, .6); border-radius: 6px; color: #fff; font: inherit; font-size: 13px; padding: 2px 6px; outline: 0; }
#sbConvs.drag-over { background: rgba(255, 160, 64, .07); border-radius: 10px; box-shadow: inset 0 0 0 1.5px rgba(255, 160, 64, .5); }
.sb-foot { font-size: 11.5px; color: #6e5f54; text-align: center; padding-top: 4px; }
.project-sheet { width: min(520px, 94vw); }
.project-sheet label { display: block; font-size: 13px; color: #ddd0c4; margin: 14px 0 6px; }
.project-sheet label small { color: var(--muted); }
.project-sheet input, .project-sheet textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.3); color: var(--text); font: inherit; font-size: 14px; outline: none; resize: vertical; }
.project-sheet input:focus, .project-sheet textarea:focus { border-color: rgba(255, 160, 64, .6); }
.color-row { display: flex; gap: 8px; margin-top: 14px; }
.color-row button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; transition: transform .2s var(--spring); }
.color-row button:hover { transform: scale(1.15); }
.color-row button.on { border-color: #fff; transform: scale(1.15); }
@keyframes slideRight { from { transform: translateX(-30px); opacity: 0; } }
@media (max-width: 900px) { .sidebar { position: absolute; left: 0; top: 0; bottom: 0; } }

/* ================================================================ code repliable */
.code-block { margin: 8px 0; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(0,0,0,.35); overflow: hidden; transition: border-color .2s; }
.code-block:hover { border-color: rgba(255, 160, 64, .4); }
.code-block summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 9px 12px; cursor: pointer; font-size: 13px; color: var(--soft); user-select: none; }
.code-block summary::-webkit-details-marker { display: none; }
.code-block summary .ci { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 193, 77, .12); color: #ffcf7a; flex: none; }
.code-block summary .ci svg { width: 14px; height: 14px; }
.code-block summary b { color: var(--text); font-weight: 600; white-space: nowrap; }
.code-block summary .first { flex: 1; min-width: 0; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-block summary .chev { width: 15px; height: 15px; color: var(--muted); transition: transform .25s var(--ease); }
.code-block[open] summary .chev { transform: rotate(180deg); }
.code-block summary .copy-code { position: static; opacity: 1; font-size: 11.5px; padding: 3px 9px; border-radius: 7px; background: rgba(255,255,255,.07); color: var(--soft); }
.code-block summary .copy-code:hover { background: rgba(255,255,255,.14); color: #fff; }
.code-block pre { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; max-height: 420px; animation: fade .3s; }
.code-block.writing summary .ci { animation: softPulse 1s infinite; }

/* ================================================================ minuteurs */
.tchrono { font-variant-numeric: tabular-nums; font-size: 12.5px; color: #ffe0a8; margin-left: 8px; font-weight: 500; }
.msg-time { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11.8px; color: var(--muted); animation: fade .4s; }
.msg-time svg { width: 13px; height: 13px; }
.msg-time b { color: var(--soft); font-weight: 600; }
.mem-item.fiche { display: block; padding: 0; }
.mem-item.fiche summary { list-style: none; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer; }
.mem-item.fiche summary::-webkit-details-marker { display: none; }
.mem-item.fiche:hover summary button { opacity: 1; }
.fiche-txt { padding: 0 12px 12px; font-size: 12.8px; color: var(--soft); max-height: 300px; overflow: auto; }
.fiche-txt p { margin: 0 0 6px; }

/* ================================================================ animations au défilement */
.scroll .msg, .scroll .trace { transition: opacity .55s var(--ease), transform .55s var(--spring), filter .55s var(--ease); }
.scroll .seen { animation: none !important; }
.scroll .offscreen { opacity: 0; transform: translateY(var(--off, 28px)) scale(.96); filter: blur(3px); }
.scroll.fast .msg, .scroll.fast .trace { transition-duration: .3s; }
.to-bottom { position: absolute; right: 34px; bottom: 112px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 10px 30px rgba(255, 122, 26, .45); z-index: 5; opacity: 0; transform: translateY(20px) scale(.6); pointer-events: none; transition: opacity .3s var(--ease), transform .4s var(--spring); }
.to-bottom.show { opacity: 1; transform: none; pointer-events: auto; animation: bob 2s ease-in-out infinite; }
.to-bottom:hover { filter: brightness(1.1); }
.to-bottom svg { width: 20px; height: 20px; }
@keyframes bob { 50% { transform: translateY(-4px); } }
/* Dictée en cours : la zone de saisie respire */
.composer.dictating { box-shadow: 0 20px 60px rgba(0, 0, 0, .45), 0 0 0 2px rgba(255, 90, 31, .55), 0 0 40px rgba(255, 90, 31, .3); animation: dictate 1.6s ease-in-out infinite; }
@keyframes dictate { 50% { box-shadow: 0 20px 60px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 90, 31, .8), 0 0 60px rgba(255, 90, 31, .45); } }

/* ================================================================ modes Nova / Nova Code */
.center-group { display: flex; align-items: center; gap: 10px; }
.mode-switch { position: relative; display: flex; height: 44px; padding: 4px; border-radius: 15px; background: var(--glass-2); border: 1px solid var(--line-2); }
.mode-switch button { position: relative; z-index: 1; padding: 0 14px; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: var(--soft); transition: color .3s; white-space: nowrap; }
.mode-switch button.on { color: #fff; }
.mode-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: var(--w, 60px); transform: translateX(var(--x, 0)); border-radius: 11px; background: var(--grad); box-shadow: 0 6px 18px rgba(255, 122, 26, .35); transition: transform .45s var(--spring), width .45s var(--spring), background .4s; }
body.mode-code .mode-thumb { background: linear-gradient(135deg, #ffc163, #ff7a1a 45%, #38bdf8 140%); }
body.mode-code .hero h1 .grad-text::after { content: " Code"; }
.mode-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 122, 26, .14); color: #ffcf7a; border: 1px solid rgba(255, 122, 26, .35); margin-left: 8px; animation: popIn .4s var(--spring); }
.suggest-code { display: block; margin-top: 10px; font-style: normal; }

/* ================================================================ images générées dans le chat */
.gen-image { margin-top: 4px; max-width: 460px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); animation: imageIn .8s var(--spring) both; position: relative; background: rgba(0,0,0,.3); }
.gen-image img { display: block; width: 100%; cursor: zoom-in; animation: imageReveal 1.2s var(--ease) both; }
.gen-image .cap { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 12.5px; color: var(--soft); border-top: 1px solid var(--line); }
.gen-image .cap span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-image .cap a { color: #ffcf7a; text-decoration: none; font-weight: 600; }
@keyframes imageIn { from { opacity: 0; transform: translateY(16px) scale(.92); } }
@keyframes imageReveal { from { filter: blur(18px) saturate(.4); transform: scale(1.06); } }

/* ================================================================ page Paramètres */
.settings-panel { width: min(640px, 96vw); display: flex; flex-direction: column; }
.set-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 6px; }
.set-tabs button { padding: 8px 13px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--soft); background: rgba(255,255,255,.04); border: 1px solid var(--line); transition: all .25s var(--ease); }
.set-tabs button:hover { color: #fff; transform: translateY(-1px); }
.set-tabs button.on { color: #fff; background: rgba(255, 122, 26, .18); border-color: rgba(255, 122, 26, .5); box-shadow: 0 0 18px rgba(255, 122, 26, .2); }
.set-page { display: none; }
.set-page.on { display: block; animation: rise .35s var(--ease); }
.seg-col { grid-template-columns: 1fr !important; }
.seg-col button small { line-height: 1.45; }
.erase-grid { display: grid; gap: 10px; margin-top: 12px; }
.erase-grid .btn { text-align: left; }
.allow-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; margin: 0 6px 6px 0; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--line-2); font-size: 12.5px; color: var(--soft); }
.confirm-always { margin-top: 14px; justify-content: center; font-size: 13px; color: var(--soft); }
@media (max-width: 1150px) { .mode-switch button { padding: 0 10px; } .access-text { display: none; } }
