/* =====================================================================================
   NOVA — interface v5 : noir pur, orange vif, rail d'icônes, accueil centré sur la saisie
   ===================================================================================== */
:root {
  --bg: #000;
  --panel-2: #111111;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #f4f4f4;
  --soft: #c4c4c4;
  --muted: #777;
  --o: #ff6a00;
  --o2: #ff9a3c;
  --o3: #ffc58a;
  --o-dim: rgba(255, 106, 0, .12);
  --green: #3ddc97;
  --amber: #fbbf24;
  --red: #ff5c5c;
  --grad: linear-gradient(100deg, #ffb066 0%, #ff6a00 55%, #ff3d00 100%);
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.45, .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.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.defs { position: absolute; width: 0; height: 0; }
code, kbd { font-family: var(--mono); }
::selection { background: var(--o); color: #000; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ================================================================ fond : traits de lumière + orbe */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.orb {
  position: absolute; left: calc(50% + 166px); top: 34%; width: 900px; height: 900px; translate: -50% -50%;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 106, 0, .28), rgba(255, 70, 0, .08) 55%, transparent 75%);
  transition: top 1.2s var(--ease), left .5s var(--ease), opacity 1.2s var(--ease), scale 1.2s var(--ease); animation: orbPulse 7s ease-in-out infinite;
}
body:not(.empty) .orb { top: 115%; opacity: .7; scale: 1.3; }
body.busy .orb { animation-duration: 2.2s; opacity: 1; }
body.sb-closed .orb { left: calc(50% + 34px); }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, transparent 50%, rgba(0, 0, 0, .75) 100%); }
@keyframes orbPulse { 50% { scale: 1.08; opacity: .85; } }

/* ================================================================ structure */
.app { position: relative; z-index: 1; height: 100%; display: flex; animation: appIn 1s var(--ease) both; }
@keyframes appIn { from { opacity: 0; filter: blur(10px); } }

/* ---------- rail */
.rail {
  width: 68px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 16px 0 14px;
  border-right: 1px solid var(--line); background: rgba(0, 0, 0, .55); backdrop-filter: blur(20px);
  animation: railIn .7s var(--ease) both;
}
@keyframes railIn { from { transform: translateX(-100%); } }
.rail-logo { width: 40px; height: 40px; display: grid; place-items: center; }
.rail-group { display: flex; flex-direction: column; gap: 6px; }
.rail-group .icon-btn { animation: popIn .5s var(--spring) both; }
.rail-group .icon-btn:nth-child(2) { animation-delay: .06s; } .rail-group .icon-btn:nth-child(3) { animation-delay: .12s; }
.rail-group .icon-btn:nth-child(4) { animation-delay: .18s; } .rail-group .icon-btn:nth-child(5) { animation-delay: .24s; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--muted);
  transition: color .2s, background .25s, transform .3s var(--spring);
}
.rail .icon-btn::before {
  content: ""; position: absolute; left: -13px; top: 50%; width: 3px; height: 0; border-radius: 0 3px 3px 0; background: var(--o);
  transform: translateY(-50%); transition: height .3s var(--spring);
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.rail .icon-btn:hover::before { height: 18px; }
.icon-btn:active { transform: scale(.9); }
.icon-btn.active { color: var(--o); background: var(--o-dim); }
.rail .icon-btn.active::before { height: 24px; }
.icon-btn.danger:hover { color: var(--red); background: rgba(255, 92, 92, .1); }
.rail .icon-btn.danger::before { background: var(--red); }
#voiceBtn .spk-on { display: none; } #voiceBtn.active .spk-on { display: block; } #voiceBtn.active .spk-off { display: none; }
.badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--o); color: #000; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; animation: popIn .5s var(--spring); }
#memoryBtn.learn { animation: learnGlow 1.2s ease-out; }
.status { display: flex; flex-direction: column; align-items: center; gap: 5px; font-family: var(--mono); font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.status i { 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; }
.status.working { color: var(--o2); }
.status.working i { background: var(--o); box-shadow: 0 0 14px var(--o); animation: blink .7s infinite; }

/* ---------- panneau conversations */
.sidebar {
  width: 264px; flex: none; display: flex; flex-direction: column; gap: 12px; padding: 16px 12px 12px; overflow: hidden;
  border-right: 1px solid var(--line); background: rgba(8, 8, 8, .7); backdrop-filter: blur(20px);
  transition: width .5s var(--ease), padding .5s var(--ease), opacity .35s; animation: fade .6s .15s both;
}
body.sb-closed .sidebar { width: 0; padding-left: 0; padding-right: 0; opacity: 0; border-right-color: transparent; }
.sidebar > * { min-width: 240px; }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-space { font-family: var(--mono); font-size: 11px; color: var(--o2); text-transform: uppercase; letter-spacing: 1.2px; display: flex; align-items: center; gap: 8px; }
.sb-space::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--o); box-shadow: 0 0 10px var(--o); animation: spin 4s linear infinite; }
.sb-new { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 9px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #000; background: var(--o); transition: transform .3s var(--spring), box-shadow .3s; }
.sb-new:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(255, 106, 0, .45); }
.sb-new:hover svg { transform: rotate(90deg); }
.sb-new svg { width: 15px; height: 15px; stroke-width: 2.4; transition: transform .35s var(--spring); }
.sb-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px; border-radius: 10px; background: rgba(255, 255, 255, .035); border: 1px solid transparent; color: var(--muted); transition: border-color .2s, background .2s; }
.sb-search:focus-within { border-color: rgba(255, 106, 0, .5); background: rgba(255, 106, 0, .05); }
.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-section { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.3px; color: #555; margin: 16px 6px 6px; }
.sb-section button { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); transition: all .25s var(--spring); }
.sb-section button:hover { color: var(--o); background: var(--o-dim); transform: rotate(90deg); }
.sb-section button svg { width: 14px; height: 14px; }
.sb-proj { margin-bottom: 2px; animation: rise .4s var(--ease) both; }
.sb-proj-head { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; 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, .05); }
.sb-proj-head.drag-over { box-shadow: inset 0 0 0 1.5px var(--o); }
.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: 16px; height: 16px; color: var(--pc, var(--o)); }
.sb-proj-head .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-proj-head .count { font-family: var(--mono); font-size: 10.5px; color: var(--muted); font-weight: 400; }
.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 .35s 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 dashed var(--line-2); padding-left: 6px; }
.sb-empty { font-size: 12px; color: #555; padding: 6px 8px; }
.sb-conv { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px; font-size: 13px; color: var(--soft); cursor: pointer; transition: background .2s, color .2s, transform .3s var(--spring); animation: fade .3s both; position: relative; }
.sb-conv:hover { background: rgba(255, 255, 255, .045); color: #fff; transform: translateX(3px); }
.sb-conv.active { background: rgba(255, 106, 0, .1); color: #fff; }
.sb-conv.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--o); box-shadow: 0 0 10px var(--o); }
.sb-conv.dragging { opacity: .35; }
.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: #000; border: 1px solid var(--o); border-radius: 6px; color: #fff; font: inherit; font-size: 13px; padding: 2px 6px; outline: 0; }
#sbConvs.drag-over { background: rgba(255, 106, 0, .06); border-radius: 10px; box-shadow: inset 0 0 0 1.5px rgba(255, 106, 0, .5); }
.sb-foot { font-size: 11px; color: #4d4d4d; text-align: center; }
.sidebar.code .sb-space { color: var(--o3); }

/* ---------- zone principale */
.chat { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.topbar { height: 60px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 0 22px; animation: fade .6s .2s both; }
.brand-text { display: flex; align-items: baseline; gap: 8px; }
.brand-text .name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.6px; }
.mode-tag { font-family: var(--mono); font-size: 12.5px; color: var(--o); opacity: 0; transform: translateX(-6px); transition: all .4s var(--ease); }
body.mode-code .mode-tag { opacity: 1; transform: none; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.mode-switch { position: relative; display: flex; height: 38px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.mode-switch button { position: relative; z-index: 1; padding: 0 16px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); transition: color .3s; white-space: nowrap; }
.mode-switch button:hover { color: var(--soft); }
.mode-switch button.on { color: #000; }
.mode-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: var(--w, 60px); transform: translateX(var(--x, 0)); border-radius: 9px; background: var(--o); box-shadow: 0 4px 20px rgba(255, 106, 0, .45); transition: transform .5s var(--spring), width .5s var(--spring); }
.chip { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--soft); border: 1px solid var(--line); background: rgba(255, 255, 255, .025); transition: border-color .2s, color .2s; overflow: hidden; }
.chip:hover { border-color: rgba(255, 106, 0, .5); color: #fff; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: softPulse 2.4s ease-in-out infinite; }
.chip.off .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.access { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 6px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); transition: border-color .3s, background .3s; overflow: hidden; }
.access:hover { border-color: var(--line-2); }
.access-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--red); background: rgba(255, 92, 92, .1); transition: all .3s; }
.access-icon svg { width: 14px; height: 14px; }
.access .lock-open { display: none; }
.access-text { display: flex; align-items: baseline; gap: 5px; font-size: 12.5px; }
.access-text b { font-weight: 700; }
.access-text small { font-family: var(--mono); font-size: 10.5px; color: var(--red); }
.mini-switch { width: 30px; height: 18px; border-radius: 999px; background: #2a2a2a; position: relative; transition: background .3s; }
.mini-switch span { position: absolute; width: 12px; height: 12px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .4s var(--spring); }
.access.on { border-color: rgba(255, 106, 0, .4); background: rgba(255, 106, 0, .06); }
.access.on .access-icon { color: var(--o); background: var(--o-dim); animation: unlock .5s var(--spring); }
.access.on .lock-open { display: block; } .access.on .lock-closed { display: none; }
.access.on .access-text small { color: var(--o2); }
.access.on .mini-switch { background: var(--o); }
.access.on .mini-switch span { transform: translateX(12px); }

/* ---------- accueil : la saisie au centre, puis elle glisse en bas */
.scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 10px 28px 28px; scroll-behavior: smooth; transition: flex-grow .9s var(--ease); }
.spacer { flex: 0 0 0; transition: flex-grow .9s var(--ease); }
.chat.empty .spacer { flex-grow: .85; }
.chat.empty .scroll { display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding-bottom: 26px; }
.scroll > * { max-width: 800px; margin-left: auto; margin-right: auto; }
.hero { text-align: center; width: 100%; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 11px; letter-spacing: 1.6px; color: var(--o2); padding: 6px 12px; border: 1px solid rgba(255, 106, 0, .25); border-radius: 999px; background: rgba(255, 106, 0, .05); }
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--o); box-shadow: 0 0 10px var(--o); animation: softPulse 1.8s ease-in-out infinite; }
.hero h1 { font-family: var(--display); font-size: clamp(40px, 6vw, 76px); font-weight: 800; letter-spacing: -2.5px; line-height: .98; margin: 22px 0 16px; }
.hero h1 .grad-text { background-size: 220% 100%; animation: titleFlow 5s ease-in-out infinite alternate; }
@keyframes titleFlow { to { background-position: 100% 0; } }
.hero p { color: var(--muted); font-size: 16px; margin: 0; }
.anim-in { animation: heroIn .9s var(--d, 0s) var(--ease) both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(24px); filter: blur(10px); } }

/* ---------- saisie */
.composer-wrap { flex: none; padding: 0 28px 16px; position: relative; z-index: 2; }
.composer-wrap > * { max-width: 800px; 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: 12px; background: var(--panel-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: 8px; display: grid; place-items: center; background: var(--o-dim); color: var(--o2); flex: none; overflow: hidden; position: relative; }
.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: 6px; 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(--o); animation: spin .7s linear infinite; }
.att.loading .thumb svg { opacity: .3; }
.composer {
  position: relative; display: flex; flex-direction: column; border-radius: 20px; padding: 6px;
  background: rgba(14, 14, 14, .92); border: 1px solid var(--line-2); backdrop-filter: blur(24px);
  box-shadow: 0 30px 90px -30px rgba(0, 0, 0, 1), 0 0 0 6px rgba(255, 255, 255, .015);
  transition: border-color .3s, box-shadow .5s var(--ease), transform .5s var(--spring);
  animation: heroIn .9s .35s var(--ease) both;
}
.composer::before {
  content: ""; position: absolute; inset: -1px; border-radius: 21px; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 60%, var(--o2) 78%, var(--o) 88%, transparent 100%);
  -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 .4s; animation: angle 3.5s linear infinite;
}
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes angle { to { --ang: 360deg; } }
.composer:focus-within { border-color: rgba(255, 106, 0, .35); box-shadow: 0 30px 90px -30px #000, 0 0 0 6px rgba(255, 106, 0, .06), 0 0 70px -20px rgba(255, 106, 0, .5); }
.composer:focus-within::before, body.busy .composer::before { opacity: 1; }
body.busy .composer::before { animation-duration: 1.4s; }
.composer.sent { animation: sentBump .5s var(--spring); }
.composer textarea { width: 100%; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 14px 14px 6px; max-height: 200px; min-height: 52px; line-height: 1.5; }
.chat.empty .composer textarea { min-height: 72px; font-size: 17px; }
.composer textarea::placeholder { color: #5c5c5c; }
.composer-bar { display: flex; align-items: center; gap: 4px; padding: 2px 2px 0; }
.kbd-hint { flex: 1; text-align: right; padding-right: 10px; font-size: 11px; color: #4d4d4d; white-space: nowrap; overflow: hidden; }
kbd { font-size: 10.5px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--muted); }
.c-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; transition: color .2s, background .2s, transform .35s var(--spring), box-shadow .3s; overflow: hidden; }
.mic, .attach { color: var(--muted); }
.mic:hover, .attach:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.attach:hover svg { animation: wiggle .5s; }
.mic.listening { color: #000; background: var(--o); animation: pulse 1.2s infinite; }
.send { background: var(--o); color: #000; }
.send svg { stroke-width: 2.4; }
.send:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(255, 106, 0, .55); }
.send:hover svg { animation: nudge .6s var(--ease); }
.send.fly svg { animation: fly .5s var(--ease); }
.stop { background: rgba(255, 92, 92, .14); color: var(--red); border: 1px solid rgba(255, 92, 92, .4); animation: popIn .35s var(--spring); }
.composer.dictating { border-color: var(--o); animation: dictate 1.6s ease-in-out infinite; }
@keyframes dictate { 50% { box-shadow: 0 0 0 4px rgba(255, 106, 0, .25), 0 0 60px rgba(255, 106, 0, .35); } }

/* Suggestions sous la saisie (seulement à l'accueil) */
.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; transition: opacity .4s, transform .5s var(--ease), max-height .6s var(--ease), margin .6s; max-height: 120px; }
.chat:not(.empty) .cards { opacity: 0; transform: translateY(10px); max-height: 0; margin-top: 0; pointer-events: none; overflow: hidden; }
.card-btn {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px; font-size: 13px; color: var(--soft);
  border: 1px solid var(--line); background: rgba(255, 255, 255, .025); overflow: hidden;
  transition: color .2s, border-color .25s, background .25s, transform .35s var(--spring), box-shadow .3s; animation: heroIn .8s var(--d, .4s) var(--ease) both;
}
.card-btn b { font-weight: 500; }
.card-btn:hover { color: #000; background: var(--o); border-color: var(--o); transform: translateY(-3px); box-shadow: 0 10px 30px -6px rgba(255, 106, 0, .6); }
.cb-icon { display: grid; place-items: center; color: var(--o); transition: color .2s, transform .35s var(--spring); }
.cb-icon svg { width: 16px; height: 16px; }
.card-btn:hover .cb-icon { color: #000; transform: rotate(-10deg) scale(1.1); }
.hint-line { text-align: center; font-size: 11.5px; color: #4d4d4d; padding-top: 10px; }
.hint-line b { color: var(--muted); font-weight: 600; }
.hint-line button { color: var(--o2); text-decoration: underline; text-underline-offset: 3px; }
.to-bottom { position: absolute; right: 34px; bottom: 150px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #000; background: var(--o); box-shadow: 0 10px 30px rgba(255, 106, 0, .45); z-index: 5; opacity: 0; transform: translateY(20px) scale(.6); pointer-events: none; transition: opacity .3s var(--ease), transform .45s var(--spring); }
.to-bottom.show { opacity: 1; transform: none; pointer-events: auto; animation: bob 2s ease-in-out infinite; }
.to-bottom svg { width: 18px; height: 18px; stroke-width: 2.3; }

/* ================================================================ messages */
.msg { display: flex; gap: 14px; margin-bottom: 26px; }
.msg.user { justify-content: flex-end; animation: userIn .6s var(--spring) both; }
.msg.ai { animation: aiIn .7s var(--ease) both; }
.msg.restored { animation: fade .3s both; }
@keyframes userIn { from { opacity: 0; transform: translateY(18px) scale(.94); } }
@keyframes aiIn { from { opacity: 0; transform: translateY(12px); filter: blur(8px); } }
.msg .who { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px; color: var(--o); margin: 3px 0 7px; }
.msg > .nova-logo { width: 30px; height: 30px; }
.body { min-width: 0; max-width: 86%; }
.text { line-height: 1.7; word-wrap: break-word; color: #e9e9e9; }
.text p { margin: 0 0 10px; } .text p:last-child { margin-bottom: 0; }
.text ul, .text ol { margin: 4px 0 10px; padding-left: 22px; }
.text li { margin: 3px 0; } .text li::marker { color: var(--o); }
.text h4 { margin: 14px 0 6px; font-size: 16px; font-family: var(--display); }
.text strong, .text b { color: #fff; }
.msg.user .text { background: var(--o); color: #0a0a0a; font-weight: 500; padding: 11px 17px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; box-shadow: 0 14px 40px -14px rgba(255, 106, 0, .8); }
.msg.user .text b, .msg.user .text strong { color: #000; }
.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: 10px; background: var(--panel-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.note .text { color: var(--muted); font-size: 13.5px; font-style: italic; }
.inline-allow, .suggest-code { display: block; margin-top: 10px; font-style: normal; }
.msg.error .text { background: rgba(255, 92, 92, .07); border: 1px solid rgba(255, 92, 92, .3); color: #ffc9c9; padding: 10px 14px; border-radius: 12px; animation: shake .5s; }
.text a { color: var(--o2); text-underline-offset: 3px; }
.text code { background: rgba(255, 106, 0, .1); color: var(--o3); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.text pre { background: #070707; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; overflow: auto; margin: 8px 0; position: relative; }
.text pre code { background: none; color: #ddd; padding: 0; font-size: 12.8px; line-height: 1.55; white-space: pre; }
.text pre .copy-code { position: absolute; top: 6px; right: 6px; font-size: 11px; padding: 3px 8px; border-radius: 7px; 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(--o); box-shadow: 0 0 10px var(--o); animation: blink .9s infinite; }
.word { animation: wordIn .35s var(--ease) both; }
.msg.speaking .text { text-shadow: 0 0 18px rgba(255, 106, 0, .35); }
.msg-actions { display: flex; gap: 2px; 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: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: all .25s var(--spring); }
.msg-actions button:hover { color: #fff; background: rgba(255, 255, 255, .07); transform: scale(1.12); }
.msg-actions button.on { color: var(--o); background: var(--o-dim); }
.msg-actions button.good.on { color: var(--green); background: rgba(61, 220, 151, .12); 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: 15px; height: 15px; }
.fb-box { display: flex; gap: 8px; margin-top: 8px; animation: rise .3s var(--ease); }
.fb-box input { flex: 1; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: #0a0a0a; color: var(--text); padding: 0 12px; font: inherit; font-size: 13.5px; outline: none; }
.fb-box input:focus { border-color: var(--o); }

/* Nova réfléchit */
.thinking-row { align-items: center; gap: 14px; animation: fade .3s both; }
.thinking-row .nova-logo { width: 44px; height: 44px; margin: 0; }
.think-label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shimmer { font-weight: 600; font-size: 15px; background: linear-gradient(90deg, #666 0%, #fff 40%, var(--o2) 50%, #666 70%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }
.think-sub { font-family: var(--mono); font-size: 11.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(--o); 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 (étapes en direct) */
.trace { margin: 0 0 20px; margin-left: max(44px, calc((100% - 800px) / 2 + 44px)); margin-right: max(0px, calc((100% - 800px) / 2)); max-width: none !important; border-radius: 14px; background: rgba(10, 10, 10, .8); border: 1px solid var(--line); overflow: hidden; animation: traceIn .55s var(--spring) both; position: relative; }
.trace.live { border-color: rgba(255, 106, 0, .3); box-shadow: 0 16px 50px -20px rgba(255, 106, 0, .4); }
.trace.live::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--o2), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: scan 1.4s linear infinite; }
.trace-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; text-align: left; }
.trace-head .nova-logo { width: 20px; height: 20px; }
.trace-head .tt { font-weight: 600; font-size: 13.5px; }
.trace-head .tmeta { font-family: var(--mono); font-size: 11px; 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 .45s 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: #bdbdbd; white-space: pre-wrap; border-left: 2px solid var(--o); 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: 26px 1fr; gap: 10px; align-items: start; animation: stepIn .45s var(--spring) both; cursor: pointer; }
.tstep .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: var(--soft); position: relative; transition: all .3s; }
.tstep .ic svg { width: 13px; height: 13px; }
.tstep .t { font-size: 13px; font-weight: 600; display: flex; gap: 8px; justify-content: space-between; padding-top: 4px; }
.tstep .t em { font-family: var(--mono); font-style: normal; font-size: 10.5px; font-weight: 400; color: var(--muted); }
.tstep .d { font-family: var(--mono); font-size: 11.5px; color: var(--muted); word-break: break-word; }
.tstep .r { font-size: 11.5px; color: #a8a8a8; white-space: pre-wrap; max-height: 0; overflow: hidden; transition: max-height .35s var(--ease), margin .3s; font-family: var(--mono); }
.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: var(--o2); border-color: rgba(255, 106, 0, .5); }
.tstep.running .ic::after { content: ""; position: absolute; inset: -4px; border-radius: 11px; border: 2px solid transparent; border-top-color: var(--o); 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: #000; background: var(--o); border-color: var(--o); animation: pop .45s var(--spring); }
.tstep.error .ic { color: var(--red); background: rgba(255, 92, 92, .1); border-color: rgba(255, 92, 92, .3); animation: shake .45s; }

/* Blocs de code repliables */
.code-block { margin: 8px 0; border: 1px solid var(--line); border-radius: 12px; background: #070707; overflow: hidden; transition: border-color .2s, box-shadow .3s; }
.code-block:hover { border-color: rgba(255, 106, 0, .4); box-shadow: 0 12px 40px -18px rgba(255, 106, 0, .5); }
.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: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--o-dim); color: var(--o); flex: none; }
.code-block summary .ci svg { width: 13px; height: 13px; }
.code-block summary b { color: var(--text); font-family: var(--mono); font-size: 12px; font-weight: 600; white-space: nowrap; }
.code-block summary .first { flex: 1; min-width: 0; font-family: var(--mono); font-size: 11.5px; 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: 11px; padding: 3px 9px; border-radius: 6px; background: rgba(255, 255, 255, .07); color: var(--soft); }
.code-block summary .copy-code:hover { background: var(--o); color: #000; }
.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, images, badges */
.tchrono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--o2); margin-left: 8px; font-weight: 400; }
.msg-time { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-family: var(--mono); font-size: 10.8px; color: #5c5c5c; animation: fade .4s; }
.msg-time svg { width: 12px; height: 12px; }
.msg-time b { color: var(--muted); font-weight: 600; }
.gen-image { margin-top: 4px; max-width: 460px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -20px rgba(255, 106, 0, .35); animation: imageIn .8s var(--spring) both; background: #0a0a0a; }
.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: var(--o2); text-decoration: none; font-weight: 600; }
.mode-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--o-dim); color: var(--o2); border: 1px solid rgba(255, 106, 0, .35); margin-left: 8px; animation: popIn .4s var(--spring); }

/* Animations au défilement */
.scroll .msg, .scroll .trace { transition: opacity .55s var(--ease), transform .6s var(--spring), filter .55s var(--ease); }
.scroll .seen { animation: none !important; }
.scroll .offscreen { opacity: 0; transform: translateY(var(--off, 28px)) scale(.96); filter: blur(4px); }
.scroll.fast .msg, .scroll.fast .trace { transition-duration: .3s; }
.scroll::-webkit-scrollbar, .drawer-panel::-webkit-scrollbar, .trace-inner > div::-webkit-scrollbar, .sb-scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb, .drawer-panel::-webkit-scrollbar-thumb, .trace-inner > div::-webkit-scrollbar-thumb, .sb-scroll::-webkit-scrollbar-thumb { background: #262626; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.scroll::-webkit-scrollbar-thumb:hover { background-color: var(--o); }

/* ================================================================ logo (anneau + 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, 140, 50, .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: 50px 20px; 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: var(--o); stroke-width: 2; opacity: 0; transform-origin: 50px 50px; }
.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; }
.nova-logo.thinking .spin { animation: spin 1.2s 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, 106, 0, .4), transparent 65%); animation: glow 1.4s ease-in-out infinite; z-index: -1; }
.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: 96px; height: 96px; }

/* ================================================================ fenêtres, panneaux */
.dropzone { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0, 0, 0, .75); backdrop-filter: blur(8px); animation: fade .2s; }
.drop-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 46px 70px; border-radius: 24px; border: 2px dashed var(--o); background: rgba(255, 106, 0, .06); animation: pop .35s var(--spring); }
.drop-card svg { width: 44px; height: 44px; color: var(--o); animation: floatY 1.6s ease-in-out infinite; }
.drop-card b { font-size: 19px; } .drop-card small { color: var(--muted); }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255, 160, 90, .35); animation: ripple .6s ease-out; pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0, 0, 0, .7); backdrop-filter: blur(10px); animation: fade .2s; }
.sheet { position: relative; width: min(500px, 92vw); padding: 30px; border-radius: 22px; background: #0c0c0c; border: 1px solid var(--line-2); box-shadow: 0 40px 120px #000; animation: pop .45s var(--spring); }
.sheet::before { content: ""; position: absolute; left: 10%; right: 10%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--o), transparent); }
.sheet h2 { font-family: var(--display); font-size: 22px; font-weight: 750; letter-spacing: -.4px; margin: 14px 0 6px; text-align: center; }
.access-sheet { width: min(540px, 94vw); text-align: center; }
.access-sheet .nova-logo { margin: 0 auto; width: 76px; height: 76px; }
.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: 13px; background: rgba(255, 255, 255, .03); 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; }
.pi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--o-dim); color: var(--o); }
.pi svg { width: 18px; height: 18px; }
.reassure { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 12.8px; color: var(--soft); background: rgba(255, 106, 0, .05); border: 1px solid rgba(255, 106, 0, .2); padding: 11px 13px; border-radius: 12px; line-height: 1.45; }
.reassure svg { color: var(--o); width: 19px; height: 19px; margin-top: 1px; }
.confirm { text-align: center; }
.warn-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto; display: grid; place-items: center; color: #000; background: var(--o); box-shadow: 0 0 40px rgba(255, 106, 0, .5); animation: wiggle .6s .2s; }
.warn-icon svg { width: 28px; height: 28px; stroke-width: 2.3; }
.confirm p { color: var(--soft); margin: 0 0 12px; }
.confirm pre { text-align: left; background: #050505; border: 1px solid var(--line); border-radius: 12px; 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: var(--mono); margin: 0; }
.confirm-always { margin-top: 14px; justify-content: center; font-size: 13px; color: var(--soft); }
.row { display: flex; gap: 10px; margin-top: 20px; }
.row .btn { flex: 1; }
.btn { height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); font-weight: 600; transition: all .25s var(--ease); overflow: hidden; }
.btn:hover { border-color: rgba(255, 106, 0, .5); background: rgba(255, 106, 0, .07); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--o); border-color: var(--o); color: #000; }
.btn.primary:hover { background: #ff7d1f; box-shadow: 0 10px 30px -6px rgba(255, 106, 0, .7); transform: translateY(-1px); }
.btn.small { height: 38px; padding: 0 14px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 26px; }
.danger-text { color: var(--red); }
.danger-text:hover { border-color: rgba(255, 92, 92, .45); background: rgba(255, 92, 92, .08); }
.drawer { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); animation: fade .2s; }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(460px, 96vw); background: #0a0a0a; border-left: 1px solid var(--line-2); padding: 26px 28px; overflow-y: auto; animation: slide .5s var(--ease); box-shadow: -40px 0 100px #000; }
.drawer-panel::before { content: ""; position: absolute; left: -1px; top: 10%; bottom: 10%; width: 1px; background: linear-gradient(180deg, transparent, var(--o), transparent); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer h2 { margin: 0; font-size: 24px; font-family: var(--display); font-weight: 800; letter-spacing: -.6px; }
.drawer h3 { font-family: var(--mono); font-size: 10.5px; font-weight: 400; text-transform: uppercase; letter-spacing: 1.5px; color: var(--o2); margin: 28px 0 12px; }
.drawer label { display: block; font-size: 13px; color: var(--soft); margin: 14px 0 6px; }
.drawer input:not([type=checkbox]):not([type=range]), .drawer select, .project-sheet input, .project-sheet textarea { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #050505; color: var(--text); font: inherit; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.project-sheet textarea { height: auto; padding: 10px 12px; resize: vertical; }
.drawer input:focus, .drawer select:focus, .project-sheet input:focus, .project-sheet textarea:focus { border-color: var(--o); box-shadow: 0 0 0 4px rgba(255, 106, 0, .12); }
.drawer input[type=range] { width: 100%; accent-color: var(--o); }
.drawer select option { background: #111; }
.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: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); text-align: left; display: flex; flex-direction: column; gap: 3px; transition: all .25s var(--ease); overflow: hidden; }
.seg button:hover { border-color: rgba(255, 106, 0, .4); }
.seg button small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.seg button.on { border-color: var(--o); background: rgba(255, 106, 0, .08); box-shadow: inset 0 0 0 1px var(--o); }
.seg button.on b { color: var(--o2); }
.seg-col { grid-template-columns: 1fr !important; }
.box { margin-top: 6px; }
.switch { display: flex !important; align-items: center; gap: 12px; cursor: pointer; }
.switch input { display: none; }
.switch > span { width: 40px; height: 22px; border-radius: 999px; background: #2a2a2a; position: relative; transition: background .3s; flex: none; }
.switch > span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .4s var(--spring); }
.switch input:checked + span { background: var(--o); }
.switch input:checked + span::after { transform: translateX(18px); }
.big-switch { align-items: flex-start !important; padding: 13px; border-radius: 13px; background: rgba(255, 255, 255, .025); 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: 8px; background: #050505; border: 1px solid var(--line); position: relative; overflow: hidden; }
.progress div { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--o); opacity: .35; transition: width .3s; }
.progress span { position: relative; font-family: var(--mono); font-size: 11.5px; line-height: 26px; padding-left: 10px; }
.settings-panel { width: min(640px, 96vw); display: flex; flex-direction: column; }
.set-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 20px 0 6px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.set-tabs button { flex: 1; padding: 8px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: all .25s var(--ease); white-space: nowrap; }
.set-tabs button:hover { color: #fff; }
.set-tabs button.on { color: #000; background: var(--o); box-shadow: 0 4px 16px rgba(255, 106, 0, .4); }
.set-page { display: none; }
.set-page.on { display: block; animation: rise .4s var(--ease); }
.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); }
.project-sheet { width: min(520px, 94vw); }
.project-sheet label { display: block; font-size: 13px; color: var(--soft); margin: 14px 0 6px; }
.project-sheet label small { color: var(--muted); }
.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 .25s var(--spring); }
.color-row button:hover { transform: scale(1.15); }
.color-row button.on { border-color: #fff; transform: scale(1.15); }

/* Mémoire */
.mem-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.mem-stats div { padding: 12px 8px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); text-align: center; animation: popIn .45s var(--spring) both; }
.mem-stats b { display: block; font-family: var(--display); font-size: 24px; font-weight: 800; color: var(--o); }
.mem-stats small { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.mem-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; background: rgba(255, 255, 255, .025); 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: rgba(255, 106, 0, .3); }
.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: 7px; 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(255, 92, 92, .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; }
.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; }

/* Notifications */
.toasts { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: #111; border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; animation: toastIn .55s var(--spring) both; box-shadow: 0 20px 50px #000; display: flex; gap: 10px; align-items: center; max-width: 560px; }
.toast.mem { border-color: rgba(255, 106, 0, .5); box-shadow: 0 20px 50px #000, 0 0 30px rgba(255, 106, 0, .25); }
.toast.mem svg { color: var(--o); animation: iconPop .6s var(--spring); }
.toast.out { animation: toastOut .4s var(--ease) forwards; }

/* ================================================================ animations */
@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: 128.3 60.2; } }
@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 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(100%); } }
@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: -40% 0; } to { background-position: 140% 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 106, 0, .6); } 50% { box-shadow: 0 0 0 9px rgba(255, 106, 0, 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(.98); } }
@keyframes fly { 50% { transform: translateX(26px); opacity: 0; } 51% { transform: translateX(-26px); } }
@keyframes nudge { 50% { transform: translateX(3px); } }
@keyframes learnGlow { 0% { box-shadow: 0 0 0 0 rgba(255, 106, 0, .7); } 100% { box-shadow: 0 0 0 16px rgba(255, 106, 0, 0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.95); } }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes imageIn { from { opacity: 0; transform: translateY(16px) scale(.92); } }
@keyframes imageReveal { from { filter: blur(18px) saturate(.4); transform: scale(1.06); } }

@media (max-width: 1100px) { .access-text, .kbd-hint { display: none; } .chip { max-width: 150px; } }
@media (max-width: 900px) {
  .sidebar { position: absolute; left: 68px; top: 0; bottom: 0; z-index: 5; }
  .topbar { grid-template-columns: auto 1fr; } .actions { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Fond : seulement le fond animé choisi (plus d'orbe) */
.orb { display: none; }
.fond-seg { grid-template-columns: repeat(4, 1fr); }
.fond-seg button { padding: 10px; }

/* ================================================================ vraie application : barre de titre intégrée */
.install-btn { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px 0 10px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: #000; background: var(--o); box-shadow: 0 6px 24px rgba(255, 106, 0, .4); animation: popIn .5s var(--spring), installPulse 2.4s 1s ease-in-out infinite; }
.install-btn svg { width: 16px; height: 16px; stroke-width: 2.4; }
.install-btn:hover { transform: translateY(-1px); background: #ff7d1f; }
@keyframes installPulse { 50% { box-shadow: 0 0 0 6px rgba(255, 106, 0, .15), 0 6px 24px rgba(255, 106, 0, .4); } }
/* Quand la barre de titre de Windows est cachée (mode « window-controls-overlay ») :
   la barre du haut de Nova sert à déplacer la fenêtre, et on laisse la place aux boutons réduire / agrandir / fermer. */
@media (display-mode: window-controls-overlay) {
  .topbar, .rail-logo, .sb-head { -webkit-app-region: drag; app-region: drag; }
  .topbar button, .topbar .mode-switch, .sb-head button, .topbar .chip, .topbar .access { -webkit-app-region: no-drag; app-region: no-drag; }
  .topbar { height: max(60px, env(titlebar-area-height, 0px)); padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 14px); }
}

/* Barre de fenêtre Electron : boutons natifs à droite, zone de déplacement au centre. */
body.fenetre-nova .topbar, body.fenetre-nova .rail-logo { app-region: drag; }
body.fenetre-nova .topbar button, body.fenetre-nova .topbar .mode-switch { app-region: no-drag; }
body.fenetre-nova .topbar { padding-right: calc(14px + 100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, calc(100vw - 138px))); }

/* ================================================================ niveau (sous la zone de saisie) */
.niv { position: relative; }
.niv-btn { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 9px 0 10px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--soft); border: 1px solid var(--line); background: rgba(255, 255, 255, .03); transition: border-color .2s, color .2s, background .2s; }
.niv-btn:hover { color: #fff; border-color: rgba(255, 106, 0, .45); background: rgba(255, 106, 0, .07); }
.niv-btn > svg { width: 14px; height: 14px; color: var(--muted); transition: transform .3s var(--ease); }
.niv:has(.niv-menu:not(.hidden)) .niv-btn > svg { transform: rotate(180deg); }
.niv-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.niv-bars i { width: 3px; border-radius: 1px; background: #333; transition: background .3s; }
.niv-bars i:nth-child(1) { height: 4px; } .niv-bars i:nth-child(2) { height: 6px; } .niv-bars i:nth-child(3) { height: 8px; } .niv-bars i:nth-child(4) { height: 10px; } .niv-bars i:nth-child(5) { height: 12px; }
.niv[data-barres="1"] .niv-btn .niv-bars i:nth-child(-n + 1), .niv-bars[data-barres="1"] i:nth-child(-n + 1) { background: var(--o); }
.niv[data-barres="2"] .niv-btn .niv-bars i:nth-child(-n + 2), .niv-bars[data-barres="2"] i:nth-child(-n + 2) { background: var(--o); }
.niv[data-barres="3"] .niv-btn .niv-bars i:nth-child(-n + 3), .niv-bars[data-barres="3"] i:nth-child(-n + 3) { background: var(--o); }
.niv[data-barres="4"] .niv-btn .niv-bars i:nth-child(-n + 4), .niv-bars[data-barres="4"] i:nth-child(-n + 4) { background: var(--o); }
.niv[data-barres="5"] .niv-btn .niv-bars i:nth-child(-n + 5), .niv-bars[data-barres="5"] i:nth-child(-n + 5) { background: var(--o); }
.niv[data-niveau="extra"] .niv-btn { color: var(--o2); border-color: rgba(255, 106, 0, .4); box-shadow: 0 0 18px rgba(255, 106, 0, .18); }
.niv-menu {
  position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 30; width: 320px; padding: 6px; border-radius: 16px;
  background: #0d0d0d; border: 1px solid var(--line-2); box-shadow: 0 24px 70px #000, 0 0 0 1px rgba(0, 0, 0, .5);
  animation: nivIn .3s var(--spring) both; transform-origin: bottom left;
}
.chat.empty .niv-menu { bottom: auto; top: calc(100% + 10px); transform-origin: top left; }
@keyframes nivIn { from { opacity: 0; transform: translateY(8px) scale(.95); } }
.niv-titre { font-family: var(--mono); font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--o2); padding: 8px 10px 6px; }
.niv-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; text-align: left; transition: background .2s; animation: rise .3s var(--ease) both; }
.niv-item:hover { background: rgba(255, 255, 255, .05); }
.niv-item.on { background: rgba(255, 106, 0, .1); }
.niv-item .niv-bars { flex: none; }
.niv-txt { flex: 1; min-width: 0; }
.niv-txt b { display: block; font-size: 13.5px; }
.niv-txt small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.niv-ok { width: 16px; height: 16px; color: var(--o); stroke-width: 2.4; }
.niv-pied { font-size: 11px; color: #555; padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.composer { z-index: 5; }
.cards { position: relative; z-index: 1; }

/* Surlignage : noir dans les bulles orange de l utilisateur, orange ailleurs (texte de Nova) */
.msg.user .text::selection, .msg.user .text *::selection { background: #000; color: #ff9a3c; }

/* Appli installée : les panneaux et fenêtres commencent SOUS les boutons réduire / agrandir / fermer de Windows */
@media (display-mode: window-controls-overlay) {
  .drawer-panel { top: env(titlebar-area-height, 36px); }
  .toasts { top: calc(env(titlebar-area-height, 36px) + 64px); }
  .modal { padding-top: env(titlebar-area-height, 36px); }
}

/* Choix proposés par Uneva (boutons cliquables dans sa réponse) */
.choix { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.choix .choix-btn { animation: none; }

/* Aperçu d'un site créé par Uneva, directement dans la conversation */
.apercu-site { margin: 10px 0; border: 1px solid #2a2a2a; border-radius: 14px; overflow: hidden; background: #0b0b0b; }
.apercu-barre { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #2a2a2a; font-size: 13px; color: #bbb; }
.apercu-site iframe { display: block; width: 100%; height: 520px; border: 0; background: #fff; }

/* Jauge « Mon utilisation » (réglages) */
.usage-box { margin-top: 8px; }
.usage-chiffres { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.usage-chiffres b { font-size: 17px; }
.usage-chiffres span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.usage-barre { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.usage-barre i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--grad); transition: width .6s var(--ease); }
.usage-barre i.plein { background: var(--red); }
.usage-barre i.ill { background: var(--green); opacity: .55; }

/* Tokens sous chaque réponse */
.msg-tokens { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.msg-tokens b { color: var(--soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.msg-tokens .sep { opacity: .5; }
.mini-jauge { display: inline-block; width: 64px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.mini-jauge i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.mini-jauge.presque i { background: var(--red); }

/* Carte « plus de tokens » */
.limite-carte { display: flex; gap: 18px; align-items: flex-start; margin: 14px 0; padding: 20px 22px; border-radius: 18px; border: 1px solid rgba(255, 106, 0, .45); background: radial-gradient(120% 140% at 0% 0%, rgba(255, 106, 0, .16), rgba(255, 106, 0, .03) 60%), var(--panel-2); box-shadow: 0 18px 50px -24px rgba(255, 106, 0, .55); animation: limite-arrive .6s var(--spring) both; }
.limite-icone { font-size: 38px; line-height: 1; animation: limite-pile 2.4s ease-in-out infinite; }
.limite-carte h3 { margin: 0 0 6px; font-size: 18px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.limite-carte p { margin: 0 0 10px; color: var(--soft); line-height: 1.5; }
.limite-carte .limite-doux { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; }
.limite-rebours { color: var(--o3); }
.limite-jauge { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.limite-jauge i { display: block; height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--o), var(--red)); animation: limite-remplit 1.1s var(--ease) both; }
@keyframes limite-arrive { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes limite-remplit { from { width: 0; } }
@keyframes limite-pile { 0%, 100% { transform: rotate(-90deg) scale(1); } 50% { transform: rotate(-90deg) scale(1.08); opacity: .75; } }

/* Bandeau « Nouvelle version d'Uneva » (appli PC) */
.bandeau-maj { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 12px; max-width: min(640px, calc(100% - 24px)); padding: 10px 12px 10px 16px; border-radius: 16px; border: 1px solid rgba(255, 106, 0, .5); background: rgba(14, 14, 14, .94); backdrop-filter: blur(18px); box-shadow: 0 18px 50px -20px rgba(255, 106, 0, .6); animation: limite-arrive .5s var(--spring) both; }
.bandeau-maj .maj-icone { font-size: 22px; }
.bandeau-maj .maj-icone.tourne { animation: maj-tourne 1.6s linear infinite; }
.bandeau-maj .maj-txt { flex: 1; display: grid; gap: 2px; min-width: 0; }
.bandeau-maj .maj-txt b { font-size: 14px; }
.bandeau-maj .maj-txt small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes maj-tourne { to { transform: rotate(360deg); } }
