* { margin:0; padding:0; box-sizing:border-box; }
html,body { height:100%; overflow:hidden; }
body {
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  background:#0a0a0c; color:#e0e0e0;
  display:flex; flex-direction:row;
  background-image:
    radial-gradient(ellipse 600px 400px at 10% 20%,rgba(74,108,247,.10),transparent),
    radial-gradient(ellipse 500px 500px at 85% 15%,rgba(168,85,247,.07),transparent),
    radial-gradient(ellipse 400px 300px at 50% 80%,rgba(59,130,246,.06),transparent);
}
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:rgba(255,255,255,.1);border-radius:3px}

/* === SIDEBAR (projets) === */
.sidebar {
  width:280px;flex-shrink:0;
  display:flex;flex-direction:column;
  background:rgba(10,10,12,.95);
  border-right:1px solid rgba(255,255,255,.08);
  z-index:20;transition:margin-left .25s ease;
}
.sidebar.collapsed{margin-left:-280px}

.sidebar-header{
  display:flex;align-items:center;justify-content:space-between;gap:.4rem;
  padding:.7rem .9rem;border-bottom:1px solid rgba(255,255,255,.06);
  flex-shrink:0;
}
.sidebar-title{font-size:.85rem;font-weight:700;color:#999;flex:1}

.search-box{padding:.5rem .7rem;flex-shrink:0}
.search-box input{
  width:100%;padding:.4rem .6rem;border-radius:6px;
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);
  color:#e0e0e0;font-family:inherit;font-size:.85rem;outline:none;
}
.search-box input:focus{border-color:rgba(74,108,247,.5)}

.proj-list{flex:1;overflow-y:auto;padding:.3rem .5rem;display:flex;flex-direction:column;gap:.15rem}

.proj-item{
  padding:.5rem .7rem;border-radius:6px;
  background:transparent;border:1px solid transparent;
  cursor:pointer;transition:all .15s;
  display:flex;align-items:center;gap:.4rem;
  position:relative;
}
.proj-item:hover{background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.06)}
.proj-item.active{background:rgba(74,108,247,.12);border-color:rgba(74,108,247,.3)}
.proj-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:.15rem}

.proj-name{font-size:.85rem;font-weight:600;color:#ccc;display:flex;align-items:center;gap:.4rem;min-width:0}
.proj-name .proj-name-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}
.proj-item.active .proj-name{color:#fff}
.proj-meta{font-size:.65rem;color:#555;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.proj-badge{
  display:inline-block;font-size:.6rem;padding:1px 5px;border-radius:3px;
  background:rgba(80,200,120,.12);color:#50c878;
  font-weight:700;letter-spacing:.03em;flex-shrink:0;
}
.proj-missing{opacity:.45}
.proj-missing .proj-name::after{content:' (manquant)';color:#e74c3c;font-weight:400;font-size:.7rem}

.proj-dot{
  display:inline-block;width:8px;height:8px;border-radius:50%;
  flex-shrink:0;
  animation:busyPulse 1.4s ease-in-out infinite;
}
.proj-dot.ready{
  background:#50c878;
  box-shadow:0 0 6px rgba(80,200,120,.6);
}
.proj-dot.streaming{
  background:#f39c12;
  box-shadow:0 0 6px rgba(243,156,18,.7);
}
@keyframes busyPulse{
  0%,100%{transform:scale(1);opacity:1}
  50%{transform:scale(1.4);opacity:.55}
}

.proj-section-sep{
  height:1px;background:rgba(255,255,255,.08);
  margin:.5rem .3rem;
}

.proj-actions{display:none;align-items:center;gap:.2rem;flex-shrink:0}
.proj-item:hover .proj-actions{display:flex}
.proj-actions button{
  background:none;border:none;color:#666;cursor:pointer;
  font-size:.85rem;padding:.15rem .3rem;border-radius:4px;line-height:1;
}
.proj-actions button:hover{color:#fff;background:rgba(255,255,255,.08)}
.proj-actions .btn-remove:hover{color:#e74c3c;background:rgba(231,76,60,.12)}

.proj-rename-input{
  background:rgba(255,255,255,.08);border:1px solid rgba(74,108,247,.4);
  border-radius:4px;padding:.15rem .4rem;color:#e0e0e0;
  font-family:inherit;font-size:.82rem;font-weight:600;
  outline:none;width:100%;
}

.empty-projects{
  padding:1.5rem 1rem;text-align:center;color:#666;font-size:.85rem;
}
.empty-projects b{color:#a855f7}

/* === FOLDER PICKER === */
.modal-wide{max-width:680px}
.fp-breadcrumb{
  display:flex;flex-wrap:wrap;gap:.2rem;align-items:center;
  padding:.5rem .6rem;border-radius:6px;background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);font-size:.78rem;
  font-family:'JetBrains Mono','Consolas',monospace;
}
.fp-crumb{
  color:#4a6cf7;cursor:pointer;padding:.1rem .35rem;border-radius:4px;
  text-decoration:none;
}
.fp-crumb:hover{background:rgba(74,108,247,.15)}
.fp-crumb.current{color:#fff;background:rgba(74,108,247,.2);cursor:default}
.fp-sep{color:#444;user-select:none}

.fp-list{
  max-height:40vh;overflow-y:auto;
  display:flex;flex-direction:column;gap:.1rem;
  border:1px solid rgba(255,255,255,.06);border-radius:6px;
  background:rgba(0,0,0,.2);padding:.3rem;
}
.fp-entry{
  padding:.4rem .6rem;border-radius:5px;cursor:pointer;
  display:flex;align-items:center;gap:.5rem;
  font-size:.85rem;color:#ccc;transition:background .12s;
}
.fp-entry:hover{background:rgba(255,255,255,.06)}
.fp-entry::before{content:'📁';font-size:.9rem;flex-shrink:0}
.fp-entry.parent::before{content:'⤴'}
.fp-empty{padding:1rem;text-align:center;color:#666;font-size:.85rem}

.fp-toolbar{
  display:flex;justify-content:flex-start;
}
.btn-secondary{
  background:rgba(255,255,255,.05);color:#bbb;
  border:1px dashed rgba(255,255,255,.18);
  padding:.4rem .8rem;border-radius:6px;font-weight:600;
  cursor:pointer;font-size:.82rem;font-family:inherit;transition:all .15s;
}
.btn-secondary:hover{color:#fff;border-color:rgba(74,108,247,.4);background:rgba(74,108,247,.08)}

.btn-danger{
  background:linear-gradient(135deg,#e74c3c,#c0392b);color:#fff;
  border:none;padding:.5rem 1rem;border-radius:7px;font-weight:700;
  cursor:pointer;font-size:.85rem;font-family:inherit;transition:filter .15s;
}
.btn-danger:hover{filter:brightness(1.15)}

.modal-narrow{max-width:420px}
.confirm-actions{
  display:flex;justify-content:flex-end;gap:.5rem;margin-top:.4rem;
}

.fp-actions{
  display:flex;align-items:center;gap:.6rem;
  padding-top:.4rem;border-top:1px solid rgba(255,255,255,.06);
}
.fp-name-label{
  flex:1;display:flex;align-items:center;gap:.5rem;
  font-size:.8rem;color:#888;
}
.fp-name-label input{
  flex:1;padding:.4rem .6rem;border-radius:6px;
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);
  color:#e0e0e0;font-family:inherit;font-size:.85rem;outline:none;
}
.fp-name-label input:focus{border-color:rgba(74,108,247,.5)}

/* Sidebar toggle */
.sidebar-toggle{
  position:fixed;top:.6rem;left:.6rem;z-index:25;
  width:36px;height:36px;border-radius:8px;
  background:rgba(10,10,12,.9);border:1px solid rgba(255,255,255,.1);
  color:#999;cursor:pointer;font-size:1rem;
  display:none;align-items:center;justify-content:center;
  transition:all .15s;backdrop-filter:blur(8px);
}
.sidebar-toggle:hover{color:#fff;border-color:rgba(255,255,255,.2)}
.sidebar.collapsed ~ .app-main .sidebar-toggle{display:flex}

/* === APP MAIN === */
.app-main{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0}

/* === HEADER === */
header{
  display:flex;justify-content:space-between;align-items:center;
  padding:.55rem 1rem;border-bottom:1px solid rgba(255,255,255,.08);
  flex-shrink:0;background:rgba(10,10,12,.9);backdrop-filter:blur(12px);
  gap:1rem;z-index:10;
}
.h-left{display:flex;align-items:center;gap:.7rem;min-width:0}
.brand{font-size:1rem;font-weight:800;background:linear-gradient(135deg,#4a6cf7,#a855f7);-webkit-background-clip:text;background-clip:text;color:transparent}
.current-project{font-size:.85rem;color:#888;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:'JetBrains Mono','Consolas',monospace}

.h-right{display:flex;align-items:center;gap:.6rem}
.status{display:flex;align-items:center;gap:.35rem;padding:.25rem .6rem;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);border-radius:6px;font-size:.75rem;color:#666}
.status-dot{width:8px;height:8px;border-radius:50%;background:#444}
.status.on .status-dot{background:#50c878;box-shadow:0 0 6px rgba(80,200,120,.4)}.status.on .status-txt{color:#50c878}
.status.off .status-dot{background:#e74c3c}.status.off .status-txt{color:#e74c3c}
.status.busy .status-dot{background:#f5a623;animation:pulse 1s infinite}.status.busy .status-txt{color:#f5a623}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.3}}

.btn-icon{background:none;border:1px solid rgba(255,255,255,.1);color:#999;border-radius:6px;padding:.3rem .55rem;cursor:pointer;font-size:.95rem;transition:all .15s;display:inline-flex;align-items:center;justify-content:center}
.btn-icon:hover{color:#fff;border-color:rgba(255,255,255,.2);background:rgba(255,255,255,.05)}

/* Icônes SVG flat (style Lucide), héritent de currentColor pour suivre la
   couleur du bouton parent. Stroke-only, blanc par défaut. */
.icon{display:inline-block;width:16px;height:16px;flex-shrink:0;vertical-align:middle}
.icon svg{width:100%;height:100%;display:block;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.icon.icon-sm{width:14px;height:14px}
.icon.icon-lg{width:18px;height:18px}
.icon.filled svg{fill:currentColor;stroke:none}

/* === TABS === */
/* Les tabs sont assis sur la ligne du bas de la barre (style Chrome) :
   - .tabs-bar a un padding-top mais aucun padding-bottom
   - Les tabs et le "+" partagent exactement les mêmes métriques verticales
   - Tous trois ont border-bottom:none pour fusionner avec le contenu en dessous */
.tabs-bar{
  display:none;align-items:flex-end;gap:.2rem;
  padding:.3rem .6rem 0;background:rgba(255,255,255,.02);
  border-bottom:1px solid rgba(255,255,255,.06);
  flex-shrink:0;overflow-x:auto;
}
.tabs-bar.visible{display:flex}
.tabs-list{display:flex;gap:.2rem;overflow-x:auto;min-width:0;align-items:flex-end}

.tab,
.btn-tab-new{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.3rem .7rem;border-radius:6px 6px 0 0;
  background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.06);
  border-bottom:none;
  font-size:.8rem;color:#999;cursor:pointer;white-space:nowrap;
  transition:all .15s;line-height:1.3;
  flex-shrink:0;
}
.tab{max-width:200px}
.tab .tab-title{display:inline-flex;align-items:center;gap:.35rem;min-width:0}
.tab .tab-label{overflow:hidden;text-overflow:ellipsis}
.tab:hover,
.btn-tab-new:hover{background:rgba(255,255,255,.07);color:#ccc}
.tab.active{background:rgba(74,108,247,.14);border-color:rgba(74,108,247,.35);color:#fff}
.tab-title{max-width:160px;overflow:hidden}
.tab .tab-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.tab-close{
  background:none;border:none;color:#666;cursor:pointer;font-size:.85rem;
  padding:0 .15rem;border-radius:3px;line-height:1;
}
.tab-close:hover{color:#e74c3c;background:rgba(231,76,60,.1)}

.btn-tab-new{
  font-weight:600;justify-content:center;
}
.btn-tab-new:hover{color:#fff;background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.1)}
.btn-tab-new.recording{
  color:#fff;border-color:rgba(227,52,68,.55);background:rgba(227,52,68,.14);
  animation: mic-pulse 1s ease-in-out infinite;
}
.btn-tab-new.transcribing{
  color:#ffd86b;border-color:rgba(255,216,107,.5);background:rgba(255,216,107,.08);
}
@keyframes mic-pulse {
  0%,100%{box-shadow:0 0 0 0 rgba(227,52,68,.55)}
  50%{box-shadow:0 0 0 6px rgba(227,52,68,0)}
}

/* === WORK AREA : 1+ panes côte à côte (split desktop) === */
.work-area{flex:1;display:flex;overflow:hidden;min-height:0}
.pane-placeholder-body{
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;padding:2rem;color:#888;
}
.pane-placeholder-body h3{font-size:1.1rem;color:#ccc;margin:0 0 .5rem}
.pane-placeholder-body p{margin:.2rem 0;font-size:.85rem}
.pane-placeholder-body .hint{font-size:.75rem;color:#666;max-width:340px;margin-top:.8rem;line-height:1.5}
body.dragging-project .work-area{outline:1px dashed rgba(74,108,247,.3);outline-offset:-2px}
.pane{
  flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;
  position:relative;
}
/* Léger highlight du pane focused — visible seulement en mode multi (split).
   Une bordure intérieure très discrète au top pour signaler "c'est ici que
   Ctrl+S, le mic et le focus-aware s'appliquent". */
.work-area.multi .pane.pane-focused::before{
  content:'';position:absolute;left:0;right:0;top:0;height:2px;
  background:linear-gradient(90deg,transparent,rgba(74,108,247,.55),transparent);
  pointer-events:none;z-index:5;
}
.pane-tabs{display:flex;align-items:flex-end;min-width:0}
/* Label du projet courant dans la barre d'onglets de chaque pane.
   Permet de distinguer en un coup d'œil quel pane = quel projet en split. */
.pane-project-label{
  flex-shrink:0;
  padding:.3rem .7rem .3rem .8rem;
  font-size:.78rem;font-weight:700;
  color:#a855f7;
  font-family:'JetBrains Mono','Consolas',monospace;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  max-width:200px;align-self:center;
  border-right:1px solid rgba(255,255,255,.08);
  margin-right:.3rem;letter-spacing:.02em;
}
.pane-project-label:empty{display:none}
.pane-tabs .tabs-bar{flex:1}
.pane-close{
  display:none;align-items:center;justify-content:center;
  background:none;border:none;color:#666;cursor:pointer;
  width:30px;height:30px;font-size:.95rem;margin:0 .3rem .25rem 0;
  border-radius:6px;transition:all .12s;
}
.pane-close:hover{color:#fff;background:rgba(231,76,60,.18)}
.work-area.multi .pane-close{display:inline-flex}
/* Le pane primaire ne peut jamais être fermé (il porte la sidebar/header).
   Le bouton existe dans index.html pour cohérence de markup mais reste inerte. */
.pane[data-pane-id="p0"] .pane-close{display:none !important}
/* Divider entre 2 panes — draggable col-resize */
.pane-divider{
  flex:0 0 6px;background:rgba(255,255,255,.04);
  cursor:col-resize;transition:background .12s;
  position:relative;
}
.pane-divider:hover,.pane-divider.dragging{background:rgba(74,108,247,.6)}
.pane-divider::before{
  content:'';position:absolute;inset:0 -3px;
}
/* Drop indicator quand on hover avec un drag depuis la sidebar */
.pane.drop-target-right::after,
.pane.drop-target-left::after{
  content:'';position:absolute;top:0;bottom:0;width:4px;
  background:#4a6cf7;box-shadow:0 0 12px rgba(74,108,247,.7);
  pointer-events:none;z-index:50;
}
.pane.drop-target-right::after{right:0}
.pane.drop-target-left::after{left:0}

/* === TERMINAL (intégré, pas de cadre "console") === */
.terminal-wrap{
  flex:1;position:relative;overflow:hidden;
  display:flex;flex-direction:column;
}
.terminal-host{
  flex:1;padding:1rem 1.4rem;
  display:none;background:transparent;
}
.terminal-host.active{display:block}
.terminal-host .term-instance{
  width:100%;height:100%;display:none;
}
.terminal-host .term-instance.active{display:block}

/* xterm overrides : se fond dans le site, plus de "boîte console" */
.xterm{padding:0;background:transparent !important}
.xterm .xterm-viewport{background:transparent !important}
.xterm .xterm-screen{background:transparent !important}
.xterm-helper-textarea{opacity:0}
.xterm .xterm-rows{
  font-family:'JetBrains Mono','Fira Code',Consolas,monospace;
  line-height:1.45;
}

/* === FILE MANAGER VIEW === */
.files-view{
  flex:1;display:none;flex-direction:row;
  background:rgba(0,0,0,.15);min-height:0;
}
.files-view.active{display:flex}

.files-tree-pane{
  width:280px;flex-shrink:0;
  display:flex;flex-direction:column;
  border-right:1px solid rgba(255,255,255,.08);
  background:rgba(10,10,12,.6);
  min-height:0;
}
.files-toolbar{
  display:flex;align-items:center;gap:.3rem;
  padding:.4rem .5rem;border-bottom:1px solid rgba(255,255,255,.06);
  flex-shrink:0;
}
.files-toolbar .btn-icon{padding:.25rem .45rem;font-size:.8rem}

.files-tree{
  flex:1;overflow:auto;padding:.3rem 0;font-size:.82rem;
  font-family:'JetBrains Mono','Consolas',monospace;
}
.fs-node{
  padding:.18rem .4rem .18rem 0;cursor:pointer;
  display:flex;align-items:center;gap:.3rem;
  color:#bbb;border-left:2px solid transparent;
  white-space:nowrap;user-select:none;
}
.fs-node:hover{background:rgba(255,255,255,.04);color:#fff}
.fs-node.active{background:rgba(74,108,247,.15);border-left-color:#4a6cf7;color:#fff}
.fs-icon{flex-shrink:0;width:1.1em;text-align:center;opacity:.8}
.fs-name{overflow:hidden;text-overflow:ellipsis;flex:1}
.fs-children{margin-left:1rem;display:none}
.fs-node.expanded + .fs-children{display:block}

.files-editor-pane{
  flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;
  position:relative;
}
.files-editor-header{
  display:flex;align-items:center;gap:.5rem;
  padding:.45rem .8rem;border-bottom:1px solid rgba(255,255,255,.06);
  background:rgba(10,10,12,.7);font-size:.85rem;color:#bbb;
  flex-shrink:0;
}
.fe-name{font-family:'JetBrains Mono','Consolas',monospace;color:#ddd}
.fe-dirty{color:#f5a623;font-weight:700;font-size:.85em}
.fe-dirty.show::before{content:'● '}
.fe-spacer{flex:1}

.files-editor{flex:1;min-height:0;display:none}
.files-editor.active{display:block}

.files-empty{
  flex:1;display:flex;align-items:center;justify-content:center;
  color:#666;font-size:.9rem;padding:2rem;text-align:center;
}
.files-empty.hidden{display:none}
.files-empty b{color:#4a6cf7}

/* Tab Files (pinned) : même look général que les autres, juste une teinte
   violette discrète pour le distinguer */
.tab.tab-pinned{color:#b89ce0}
.tab.tab-pinned.active{background:rgba(168,85,247,.16);border-color:rgba(168,85,247,.3);color:#fff}
.tab.tab-pinned .tab-close{display:none}

@media (max-width: 768px){
  .files-tree-pane{width:55vw;max-width:240px}
  .files-tree{font-size:.78rem}
}

.welcome{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  flex:1;gap:.7rem;opacity:.55;text-align:center;padding:2rem;
}
.welcome h2{font-size:2rem;font-weight:800;background:linear-gradient(135deg,#4a6cf7,#a855f7);-webkit-background-clip:text;background-clip:text;color:transparent}
.welcome p{font-size:1rem;color:#888;max-width:520px}

/* === MODAL === */
.modal-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.7);backdrop-filter:blur(4px);
  z-index:100;display:none;align-items:center;justify-content:center;padding:1rem;
}
.modal-overlay.visible{display:flex}
.modal{
  background:#15151a;border:1px solid rgba(255,255,255,.1);border-radius:10px;
  width:100%;max-width:520px;max-height:80vh;display:flex;flex-direction:column;
  box-shadow:0 20px 60px rgba(0,0,0,.5);
}
.modal-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:.9rem 1.1rem;border-bottom:1px solid rgba(255,255,255,.08);
}
.modal-header h3{font-size:1rem;font-weight:700;color:#fff}
.modal-body{padding:1rem 1.1rem;overflow-y:auto;display:flex;flex-direction:column;gap:.8rem}
.btn-primary{
  background:linear-gradient(135deg,#4a6cf7,#a855f7);color:#fff;
  border:none;padding:.55rem 1rem;border-radius:7px;font-weight:700;
  cursor:pointer;font-size:.9rem;font-family:inherit;transition:filter .15s;
}
.btn-primary:hover{filter:brightness(1.15)}
.btn-block{width:100%}

.session-list{display:flex;flex-direction:column;gap:.3rem;max-height:50vh;overflow-y:auto}
.session-item{
  padding:.55rem .7rem;border-radius:6px;cursor:pointer;
  background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.06);
  display:flex;flex-direction:column;gap:.2rem;transition:all .15s;
}
.session-item:hover{background:rgba(74,108,247,.1);border-color:rgba(74,108,247,.3)}
.session-title{font-size:.85rem;color:#ddd;display:flex;align-items:center;gap:.4rem;min-width:0}
.session-title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}
.session-meta{font-size:.7rem;color:#666}
.title-badge{flex:0 0 auto;font-size:.65rem;padding:1px 6px;border-radius:8px;background:rgba(74,108,247,.18);color:#9ab3ff;border:1px solid rgba(74,108,247,.3);white-space:nowrap}
.title-badge.gen{background:rgba(255,180,0,.15);color:#ffc769;border-color:rgba(255,180,0,.3);animation:title-pulse 1.4s ease-in-out infinite}
.title-badge.manual{background:rgba(140,140,140,.15);color:#bbb;border-color:rgba(140,140,140,.3)}
@keyframes title-pulse{0%,100%{opacity:.55}50%{opacity:1}}

/* === Recherche globale (Ctrl+K) === */
.search-modal{padding:0;overflow:hidden;max-width:720px;width:92vw}
.search-header{display:flex;align-items:center;gap:.5rem;padding:.7rem .9rem;border-bottom:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.02)}
.search-header .search-icon{font-size:1.1rem;opacity:.7}
.search-header input{flex:1;background:transparent;border:none;outline:none;color:#eee;font-size:1rem;font-family:inherit}
.search-header input::placeholder{color:#666}
.search-status{padding:.45rem .9rem;font-size:.72rem;color:#777;border-bottom:1px solid rgba(255,255,255,.05)}
.search-results{max-height:60vh;overflow-y:auto;padding:.3rem}
.search-item{padding:.6rem .75rem;border-radius:6px;cursor:pointer;display:flex;flex-direction:column;gap:.25rem;transition:background .12s}
.search-item:hover,.search-item.kbd-focus{background:rgba(74,108,247,.13)}
.search-item-head{display:flex;align-items:center;gap:.5rem;font-size:.88rem;color:#ddd;min-width:0}
.search-item-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-weight:500}
.search-item-proj{font-size:.7rem;padding:1px 7px;border-radius:8px;background:rgba(74,108,247,.18);color:#9ab3ff;border:1px solid rgba(74,108,247,.3);flex:0 0 auto;white-space:nowrap}
.search-item-proj.unmanaged{background:rgba(255,140,0,.15);color:#ffb060;border-color:rgba(255,140,0,.3)}
.search-item-snippet{font-size:.75rem;color:#888;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.search-item-snippet mark{background:rgba(255,200,0,.25);color:#ffd770;padding:0 2px;border-radius:2px}
.search-item-meta{font-size:.65rem;color:#666;display:flex;gap:.6rem}
.search-item-match{padding:0 5px;border-radius:6px;background:rgba(255,255,255,.05);color:#888}

/* === RESPONSIVE === */
@media (max-width: 768px){
  .sidebar{position:fixed;height:100%;width:85vw;max-width:320px;z-index:50}
  .sidebar.collapsed{margin-left:-100vw}

  /* Header: laisser de la place au hamburger en haut à gauche */
  header{padding:.5rem .6rem .5rem 3.2rem;gap:.5rem}
  .brand{display:none} /* place limitée → on garde juste le chemin et le statut WS */
  .current-project{font-size:.75rem;flex:1;min-width:0}
  .h-right{gap:.4rem}
  .status{padding:.2rem .45rem;font-size:.7rem}

  /* Toggle hamburger : toujours en haut à gauche, avec marge */
  .sidebar-toggle{
    top:.45rem;left:.45rem;width:34px;height:34px;
    z-index:60;
  }
  /* Quand la sidebar est ouverte (non collapsed), le hamburger reste utilisable par dessus */
  .sidebar:not(.collapsed) ~ .app-main .sidebar-toggle{display:none}

  /* Tabs : plus compacts, scroll horizontal natif */
  .tabs-bar{padding:.25rem .4rem 0;gap:.15rem}
  .tabs-list{gap:.15rem}
  .tab,
  .btn-tab-new{padding:.25rem .55rem;font-size:.75rem}
  .tab{max-width:160px}
  .tab-title{max-width:110px}

  /* Terminal : moins de padding pour gagner de la place */
  .terminal-host{padding:.4rem .5rem .6rem}

  /* Welcome / call-to-action */
  .welcome{padding:1rem}
  .welcome h2{font-size:1.4rem}
  .welcome p{font-size:.85rem}

  /* Modal : occupe presque tout l'écran */
  .modal{max-width:96vw;width:96vw;max-height:90vh}
  .modal-header{padding:.7rem .8rem}
  .modal-header h3{font-size:.9rem}
  .modal-body{padding:.8rem;gap:.6rem}
  .fp-list{max-height:50vh}
  .fp-actions{flex-direction:column;align-items:stretch;gap:.5rem}
  .fp-name-label{flex-direction:column;align-items:stretch;gap:.3rem}
}

/* Très petit (téléphone portrait étroit) */
@media (max-width: 420px){
  header{padding-left:2.8rem}
  .current-project{font-size:.7rem}
  .tab{max-width:130px}
  .tab-title{max-width:90px}
}

/* ============================================================
   MODE NATIVE — Chat UI built on `claude --output-format stream-json`
   Activé quand l'onglet courant est de kind 'native'.
   ============================================================ */
.native-view{
  position:absolute;inset:0;display:none;flex-direction:column;
  background:#0d0f14;
  font-family:Inter,system-ui,sans-serif;
}
.native-view.visible{display:flex}
.native-stream{
  flex:1;overflow-y:auto;padding:1rem 1.2rem 0.5rem;
  display:flex;flex-direction:column;gap:.85rem;
  scroll-behavior:smooth;
}
.native-stream::-webkit-scrollbar{width:10px}
.native-stream::-webkit-scrollbar-thumb{background:rgba(255,255,255,.08);border-radius:5px}
.native-stream::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.15)}

.nv-msg{
  display:flex;flex-direction:column;gap:.35rem;
  max-width:100%;
}
.nv-msg-role{
  font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;
  color:#888;font-weight:600;
  display:flex;align-items:center;gap:.5rem;
}
.nv-msg-role .nv-badge{
  background:rgba(74,108,247,.18);color:#9ab0ff;
  padding:.05rem .4rem;border-radius:8px;font-size:.65rem;
  letter-spacing:.04em;
}
.nv-msg.role-user .nv-msg-role{color:#7ad9a0}
.nv-msg.role-assistant .nv-msg-role{color:#9ab0ff}
.nv-msg.role-system .nv-msg-role{color:#c4a662}

.nv-msg-body{
  background:rgba(255,255,255,.025);
  border:1px solid rgba(255,255,255,.06);
  border-radius:10px;padding:.7rem .9rem;
  color:#e1e3ea;line-height:1.55;font-size:.92rem;
  word-wrap:break-word;overflow-wrap:break-word;
}
.nv-msg.role-user .nv-msg-body{
  background:rgba(122,217,160,.06);
  border-color:rgba(122,217,160,.15);
}
.nv-msg.role-assistant .nv-msg-body{
  background:rgba(74,108,247,.04);
  border-color:rgba(74,108,247,.12);
}

/* Markdown */
.nv-msg-body p{margin:.35rem 0}
.nv-msg-body p:first-child{margin-top:0}
.nv-msg-body p:last-child{margin-bottom:0}
.nv-msg-body code{
  background:rgba(255,255,255,.07);padding:.1rem .35rem;border-radius:4px;
  font-family:ui-monospace,"JetBrains Mono",monospace;font-size:.85em;
  color:#ffd86b;
}
.nv-msg-body pre{
  background:#0a0c12;border:1px solid rgba(255,255,255,.08);
  border-radius:6px;padding:.7rem .8rem;overflow-x:auto;
  margin:.5rem 0;
}
.nv-msg-body pre code{background:none;padding:0;color:#cfd6e0}
.nv-msg-body ul,.nv-msg-body ol{margin:.35rem 0;padding-left:1.4rem}
.nv-msg-body li{margin:.15rem 0}
.nv-msg-body h1,.nv-msg-body h2,.nv-msg-body h3{margin:.7rem 0 .3rem;font-weight:600}
.nv-msg-body h1{font-size:1.15rem}
.nv-msg-body h2{font-size:1.05rem}
.nv-msg-body h3{font-size:.98rem}
.nv-msg-body a{color:#9ab0ff;text-decoration:underline}
.nv-msg-body blockquote{
  border-left:3px solid rgba(255,255,255,.15);
  padding-left:.7rem;margin:.4rem 0;color:#aaa;
}

/* Thinking block */
.nv-think{
  border-left:3px solid rgba(255,216,107,.4);
  background:rgba(255,216,107,.03);
  border-radius:0 8px 8px 0;
  padding:.5rem .8rem;font-size:.85rem;color:#bda36b;
  font-style:italic;
}
.nv-think summary{
  cursor:pointer;font-weight:600;color:#ffd86b;font-style:normal;
  list-style:none;display:flex;align-items:center;gap:.4rem;
}
.nv-think summary::before{content:"💭"}
.nv-think[open] summary::after{content:"▾";margin-left:auto}
.nv-think:not([open]) summary::after{content:"▸";margin-left:auto}
.nv-think-body{margin-top:.4rem;white-space:pre-wrap}

/* Tool calls */
.nv-tool{
  background:rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;overflow:hidden;
  font-size:.85rem;
}
.nv-tool summary{
  cursor:pointer;list-style:none;
  padding:.45rem .7rem;
  display:flex;align-items:center;gap:.5rem;
  font-family:ui-monospace,monospace;color:#cfd6e0;
  background:rgba(0,0,0,.15);
}
.nv-tool summary::before{content:"🛠";opacity:.7}
.nv-tool[open] summary{border-bottom:1px solid rgba(255,255,255,.06)}
.nv-tool-name{color:#9ab0ff;font-weight:600}
.nv-tool-summary{
  color:#888;font-weight:400;
  flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;
  font-family:Inter,system-ui,sans-serif;
}
.nv-tool-status{
  font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;
  padding:.05rem .4rem;border-radius:4px;
}
.nv-tool-status.running{background:rgba(255,216,107,.18);color:#ffd86b;animation:nv-pulse 1.4s ease-in-out infinite}
.nv-tool-status.ok{background:rgba(122,217,160,.18);color:#7ad9a0}
.nv-tool-status.err{background:rgba(227,52,68,.18);color:#ff7585}
@keyframes nv-pulse {
  0%,100%{opacity:1}
  50%{opacity:.45}
}
.nv-tool-body{padding:.6rem .8rem;display:flex;flex-direction:column;gap:.4rem}
.nv-tool-body pre{
  background:#0a0c12;border:1px solid rgba(255,255,255,.06);
  border-radius:5px;padding:.5rem .65rem;margin:0;overflow-x:auto;
  font-size:.78rem;line-height:1.5;color:#cfd6e0;
  max-height:340px;overflow-y:auto;
}
.nv-tool-label{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:#888;font-weight:600}

/* System / status messages */
.nv-sys{
  align-self:center;font-size:.75rem;color:#888;
  font-style:italic;padding:.3rem .8rem;
}

/* Composer */
.native-status{
  padding:0 1.2rem;font-size:.78rem;color:#888;min-height:1.2rem;
  display:flex;align-items:center;gap:.5rem;
}
.native-status.thinking::before{
  content:"";display:inline-block;width:8px;height:8px;border-radius:50%;
  background:#ffd86b;animation:nv-pulse 1.2s ease-in-out infinite;
}
.native-status.error{color:#ff7585}

/* Composer moderne — textarea + actions DANS la même "box" arrondie */
.native-composer{
  padding:.5rem 1rem 1rem;
  border-top:1px solid rgba(255,255,255,.04);
  background:#0b0d12;
}
.composer-shell{
  background:#11141b;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:.35rem .4rem .35rem .9rem;
  display:flex;flex-direction:column;gap:.2rem;
  transition:border-color .12s, box-shadow .12s;
}
.composer-row{
  display:flex;align-items:flex-end;gap:.3rem;
}
.composer-row textarea{flex:1}
.composer-shell:focus-within{
  border-color:rgba(74,108,247,.45);
  box-shadow:0 0 0 2px rgba(74,108,247,.12);
}
.native-composer textarea{
  width:100%;background:none;border:none;resize:none;outline:none;
  color:#e1e3ea;font-family:inherit;font-size:.93rem;line-height:1.45;
  padding:.45rem 0;min-height:0;max-height:240px;
  overflow-y:auto;
}
.native-composer textarea::placeholder{color:#5f6470}
.composer-actions{
  display:flex;gap:.15rem;align-items:center;
  flex-shrink:0;
}
.composer-btn{
  background:none;border:1px solid transparent;color:#888;
  font-size:1rem;line-height:1;cursor:pointer;
  padding:.4rem .55rem;border-radius:8px;
  transition:all .12s;display:inline-flex;align-items:center;justify-content:center;
  min-width:34px;height:34px;
}
.composer-btn:hover{color:#e1e3ea;background:rgba(255,255,255,.05)}
.composer-btn[hidden]{display:none !important}
/* Séparateur visuel entre le widget contexte (fonction spéciale) et les
   autres icônes du composer */
.composer-sep{
  display:inline-block;width:1px;height:18px;
  background:rgba(255,255,255,.12);margin:0 .25rem;align-self:center;
}
/* Widget contexte (cercle de progression) */
.composer-ctx{padding:.35rem .4rem}
.composer-ctx .ctx-ring{width:20px;height:20px;display:block;transform:rotate(-90deg);overflow:visible}
.composer-ctx .ctx-track{
  fill:none;stroke:rgba(255,255,255,.12);stroke-width:3;
}
.composer-ctx .ctx-fill{
  fill:none;stroke:#9ab0ff;stroke-width:3;stroke-linecap:round;
  stroke-dasharray:0 999;transition:stroke-dasharray .4s ease, stroke .2s ease;
}
.composer-ctx.ctx-warn .ctx-fill{stroke:#f5a623}
.composer-ctx.ctx-danger .ctx-fill{stroke:#ff7585}
.composer-ctx:hover{background:rgba(255,255,255,.06)}
.composer-ctx[hidden] + .composer-sep[data-for="ctx"]{display:none}
.composer-send{
  background:rgba(74,108,247,.18);color:#9ab0ff;
  font-size:1.15rem;padding:.4rem .7rem;font-weight:700;
}
.composer-send:hover{background:rgba(74,108,247,.32);color:#fff}
.composer-stop{
  background:rgba(227,52,68,.15);color:#ff7585;
  display:none;
}
.native-composer.streaming .composer-send{display:none}
.native-composer.streaming .composer-stop{display:inline-flex}
.composer-btn.recording{
  background:rgba(227,52,68,.18) !important;color:#ff7585 !important;
  animation:nv-pulse 1s ease-in-out infinite;
}
.composer-btn.transcribing{
  background:rgba(255,216,107,.12) !important;color:#ffd86b !important;
}
.composer-btn.uploading{
  background:rgba(74,108,247,.12) !important;color:#9ab0ff !important;
  animation:nv-pulse 1s ease-in-out infinite;
}

/* Préserver les retours à la ligne dans les messages user */
.nv-msg.role-user .nv-msg-body{white-space:pre-wrap}

/* Groupage : pas de label de rôle pour les messages consécutifs du même rôle */
.nv-msg.no-role-label .nv-msg-role{display:none}
.nv-msg.no-role-label{margin-top:-.5rem}

/* Welcome state */
.nv-welcome{
  margin:auto;text-align:center;color:#888;
  display:flex;flex-direction:column;gap:.6rem;align-items:center;
  padding:2rem 1rem;
}
.nv-welcome h2{color:#e1e3ea;font-size:1.3rem;margin:0}
.nv-welcome p{margin:0;max-width:520px;line-height:1.6}
.nv-welcome .nv-hint{
  display:inline-block;background:rgba(255,255,255,.04);
  padding:.4rem .7rem;border-radius:6px;font-size:.8rem;color:#aaa;
}

/* Mobile */
@media (max-width:760px){
  .native-stream{padding:.7rem .8rem 0.3rem}
  .native-composer{padding:.5rem .6rem .7rem}
  .nv-msg-body{font-size:.88rem;padding:.6rem .75rem}
  .native-composer textarea{font-size:.88rem}
  .native-composer .native-send{padding:0 .8rem}
}

/* === DIFF VS-Code-like pour Edit/Write === */
.nv-diff-file{
  font-family:ui-monospace,monospace;font-size:.78rem;
  color:#9ab0ff;padding:.25rem 0;
}
.nv-diff-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:0;
  border-radius:6px;overflow:hidden;
  border:1px solid rgba(255,255,255,.06);
  margin:.3rem 0;
}
.nv-diff-grid .nv-diff-side{border:none;border-radius:0}
.nv-diff-grid .nv-diff-old{border-right:1px solid rgba(255,255,255,.08)}
.nv-diff-side{
  border-radius:6px;overflow:hidden;
  border:1px solid rgba(255,255,255,.06);
}
.nv-diff-side.nv-diff-full{grid-column:1/-1}
.nv-diff-old{background:rgba(227,52,68,.06);border-color:rgba(227,52,68,.18)}
.nv-diff-new{background:rgba(122,217,160,.06);border-color:rgba(122,217,160,.18)}
.nv-diff-label{
  padding:.25rem .55rem;font-size:.7rem;font-weight:700;
  text-transform:uppercase;letter-spacing:.04em;
  background:rgba(0,0,0,.15);
}
.nv-diff-old .nv-diff-label{color:#ff7585}
.nv-diff-new .nv-diff-label{color:#7ad9a0}
.nv-diff-side pre{
  margin:0;padding:.5rem .65rem;background:none;border:none;border-radius:0;
  font-size:.78rem;line-height:1.45;max-height:300px;overflow:auto;
  white-space:pre;color:#d5d9e3;
}
.nv-open-file{
  align-self:flex-start;background:rgba(74,108,247,.12);
  border:1px solid rgba(74,108,247,.3);color:#9ab0ff;
  padding:.3rem .65rem;border-radius:5px;cursor:pointer;
  font-size:.78rem;font-family:inherit;margin-top:.2rem;
  transition:all .12s;
}
.nv-open-file:hover{background:rgba(74,108,247,.22);color:#fff}

.nv-bash-cmd{
  background:#0a0c12 !important;color:#9ab0ff !important;
  font-weight:600;border:1px solid rgba(74,108,247,.2) !important;
}
.nv-tool-desc{
  font-size:.82rem;color:#aaa;
  font-family:ui-monospace,monospace;
}

@media (max-width:700px){
  .nv-diff-grid{grid-template-columns:1fr}
}

/* Attachments : chips au-dessus du textarea dans la composer-shell */
.composer-attachments{
  display:flex;flex-wrap:wrap;gap:.4rem;
  padding:0 0 .35rem;
}
.composer-attachments:empty{display:none}
.att-chip{
  display:flex;align-items:center;gap:.4rem;
  background:rgba(74,108,247,.10);
  border:1px solid rgba(74,108,247,.25);
  border-radius:8px;
  padding:.25rem .25rem .25rem .4rem;
  max-width:240px;font-size:.78rem;
  color:#cfd6e0;
}
.att-chip img{
  width:auto;height:64px;max-width:96px;
  border-radius:6px;object-fit:contain;
  background:#0a0c12;flex-shrink:0;
  display:block;
}
.att-chip .att-icon{
  width:32px;height:32px;display:flex;align-items:center;justify-content:center;
  border-radius:5px;background:rgba(255,255,255,.05);font-size:1.1rem;flex-shrink:0;
}
.att-chip .att-name{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;
}
.att-chip .att-remove{
  background:none;border:none;color:#888;cursor:pointer;
  width:22px;height:22px;border-radius:5px;font-size:1rem;line-height:1;flex-shrink:0;
}
.att-chip .att-remove:hover{background:rgba(227,52,68,.18);color:#ff7585}

/* === Modal Diff (Monaco diff editor) === */
.diff-modal{
  max-width:1400px;width:96vw;height:92vh;
  display:flex;flex-direction:column;
}
.diff-modal-body{
  flex:1;display:flex;padding:0;overflow:hidden;min-height:0;
}
.diff-editor-host{
  flex:1;width:100%;height:100%;min-height:0;
}

/* === Diff inline compact (preview dans la tool card) === */
.nv-diff-side pre{
  max-height:5.5em;overflow:hidden;
  -webkit-mask-image:linear-gradient(to bottom, #000 70%, transparent 100%);
          mask-image:linear-gradient(to bottom, #000 70%, transparent 100%);
}
.nv-diff-side.nv-diff-full pre{
  max-height:8em;
}
.nv-diff-actions{
  display:flex;gap:.4rem;flex-wrap:wrap;margin-top:.3rem;
}
.nv-diff-actions button{
  background:rgba(74,108,247,.12);
  border:1px solid rgba(74,108,247,.3);color:#9ab0ff;
  padding:.3rem .65rem;border-radius:5px;cursor:pointer;
  font-size:.78rem;font-family:inherit;
  transition:all .12s;
}
.nv-diff-actions button:hover{background:rgba(74,108,247,.22);color:#fff}

/* === IN / OUT stacked pour les tool cards (Bash, Read, Grep, …) === */
/* IN et OUT collés : conteneur unique avec une seule bordure ronde,
   cellules empilées sans gap, séparées par une ligne fine */
.nv-tool-body{display:flex;flex-direction:column}
.nv-tool-body .nv-io-cell:first-of-type{border-radius:6px 6px 0 0}
.nv-tool-body .nv-io-cell:last-of-type{border-radius:0 0 6px 6px}
.nv-tool-body .nv-io-cell:only-of-type{border-radius:6px}
.nv-io-cell{
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.18);
  transition:border-color .12s, background .12s;
}
.nv-io-cell + .nv-io-cell{
  margin-top:0;border-top:none;
}
.nv-io-cell[data-kind="in"]{border-color:rgba(74,108,247,.22);background:rgba(74,108,247,.06)}
.nv-io-cell[data-kind="out"]{border-color:rgba(122,217,160,.22);background:rgba(122,217,160,.04)}
.nv-io-cell.nv-io-err{border-color:rgba(227,52,68,.3);background:rgba(227,52,68,.06)}
.nv-io-cell.nv-io-empty{opacity:.55}
.nv-io-label{
  padding:.2rem .55rem;font-size:.66rem;font-weight:800;
  letter-spacing:.1em;background:rgba(0,0,0,.2);
}
.nv-io-cell[data-kind="in"] .nv-io-label{color:#9ab0ff}
.nv-io-cell[data-kind="out"] .nv-io-label{color:#7ad9a0}
.nv-io-cell.nv-io-err .nv-io-label{color:#ff7585}
.nv-io-content{
  margin:0;padding:.5rem .65rem;
  background:none;border:none;border-radius:0;
  font-family:ui-monospace,"JetBrains Mono",monospace;
  font-size:.79rem;line-height:1.5;color:#cfd6e0;
  max-height:5.5em;overflow:hidden;
  white-space:pre-wrap;word-break:break-word;
  position:relative;
  -webkit-mask-image:linear-gradient(to bottom, #000 70%, transparent 100%);
          mask-image:linear-gradient(to bottom, #000 70%, transparent 100%);
}
.nv-io-cell:hover .nv-io-content{filter:brightness(1.15)}

/* Cursor pointer + hover discret sur tout ce qui est cliquable (diff/cells) */
.nv-clickable{cursor:pointer;transition:filter .12s, border-color .12s}
.nv-clickable:hover{filter:brightness(1.12)}
.nv-clickable:hover.nv-io-cell{border-color:rgba(74,108,247,.45)}
.nv-clickable:hover.nv-diff-grid .nv-diff-side{border-color:rgba(74,108,247,.4)}

/* === Menu slash commands (/ dans le composer) === */
.native-composer{position:relative}
.slash-menu{
  display:none;position:absolute;bottom:100%;left:1rem;right:1rem;
  max-height:280px;overflow-y:auto;
  background:#11141b;border:1px solid rgba(74,108,247,.35);
  border-radius:10px;
  box-shadow:0 6px 24px rgba(0,0,0,.4);
  padding:.3rem;z-index:30;margin-bottom:.4rem;
}
.slash-menu.visible{display:block}
.slash-item{
  display:flex;align-items:center;gap:.5rem;
  padding:.4rem .55rem;border-radius:6px;cursor:pointer;
  font-size:.85rem;color:#cfd6e0;
  transition:background .1s;
}
.slash-item:hover, .slash-item.focused{
  background:rgba(74,108,247,.18);color:#fff;
}
.slash-cmd{
  font-family:ui-monospace,monospace;color:#9ab0ff;font-weight:600;
  flex-shrink:0;
}
.slash-desc{color:#888;font-size:.78rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* === Bloc slash command (rendu compact, style "console output") === */
.nv-msg.role-slash{
  background:rgba(168,85,247,.04);
  border:1px solid rgba(168,85,247,.2);
  border-radius:8px;
  padding:.5rem .75rem;
  font-size:.85rem;
}
.nv-slash-head{
  display:flex;align-items:center;gap:.5rem;
  margin-bottom:.4rem;
}
.nv-slash-cmd{
  font-family:ui-monospace,monospace;color:#d9b3ff;font-weight:700;
}
.nv-slash-args{
  font-family:ui-monospace,monospace;color:#aaa;font-size:.78rem;
}
.nv-slash-out{
  font-size:.85rem;color:#cfd6e0;line-height:1.5;
}
.nv-slash-out pre{
  background:#0a0c12;border:1px solid rgba(255,255,255,.06);
  border-radius:5px;padding:.45rem .6rem;margin:.3rem 0;
  font-size:.78rem;overflow:auto;
}
.nv-slash-out p{margin:.2rem 0}
.nv-slash-out table{
  border-collapse:collapse;margin:.4rem 0;font-size:.78rem;
}
.nv-slash-out th,.nv-slash-out td{
  padding:.2rem .55rem;border:1px solid rgba(255,255,255,.1);text-align:left;
}
.nv-slash-out th{background:rgba(255,255,255,.04);font-weight:600}

/* === Banner question (AskUserQuestion) au-dessus du composer === */
.question-banner{
  display:none;
  background:rgba(168,85,247,.06);
  border:1px solid rgba(168,85,247,.35);
  border-radius:12px;
  padding:.8rem 1rem;
  margin:0 1rem .55rem;
  box-shadow:0 4px 18px rgba(168,85,247,.08);
}
.question-banner.visible{display:block}
.qb-question{
  font-weight:600;color:#e1e3ea;font-size:.93rem;margin-bottom:.5rem;
  display:flex;align-items:center;gap:.5rem;
}
.qb-question::before{content:"❓";font-size:1.05rem}
.qb-header{
  display:inline-block;font-size:.66rem;padding:.1rem .4rem;
  background:rgba(168,85,247,.18);color:#d9b3ff;border-radius:5px;
  letter-spacing:.05em;text-transform:uppercase;font-weight:700;
  margin-left:auto;
}
.qb-options{
  display:flex;flex-direction:column;gap:.35rem;
}
.qb-opt{
  display:flex;align-items:flex-start;gap:.55rem;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;padding:.5rem .7rem;
  cursor:pointer;text-align:left;color:#d5d9e3;
  font-family:inherit;font-size:.87rem;line-height:1.4;
  transition:all .12s;
}
.qb-opt:hover{
  background:rgba(168,85,247,.10);
  border-color:rgba(168,85,247,.4);color:#fff;
}
.qb-opt.selected{
  background:rgba(168,85,247,.18);
  border-color:rgba(168,85,247,.6);color:#fff;
}
.qb-opt-marker{
  flex-shrink:0;width:18px;height:18px;border-radius:50%;
  border:2px solid #666;margin-top:.1rem;
  display:flex;align-items:center;justify-content:center;
  font-size:.7rem;
}
.qb-opt[data-multi="true"] .qb-opt-marker{border-radius:4px}
.qb-opt.selected .qb-opt-marker{
  border-color:#d9b3ff;background:#d9b3ff;color:#1a0e2e;
}
.qb-opt.selected .qb-opt-marker::after{content:"✓"}
.qb-opt-label{font-weight:600;color:inherit}
.qb-opt-desc{display:block;font-size:.78rem;color:#888;margin-top:.1rem;font-weight:400}
.qb-other{
  display:flex;gap:.4rem;align-items:stretch;margin-top:.4rem;
}
.qb-other input{
  flex:1;background:#11141b;color:#e1e3ea;
  border:1px solid rgba(255,255,255,.1);border-radius:6px;
  padding:.4rem .6rem;font-family:inherit;font-size:.85rem;outline:none;
}
.qb-other input:focus{border-color:rgba(168,85,247,.5)}
.qb-actions{
  display:flex;gap:.4rem;justify-content:flex-end;margin-top:.5rem;
  padding-top:.5rem;border-top:1px solid rgba(255,255,255,.06);
}
.qb-actions button{
  background:rgba(168,85,247,.18);color:#d9b3ff;
  border:1px solid rgba(168,85,247,.35);border-radius:6px;
  padding:.35rem .8rem;font-weight:600;cursor:pointer;font-family:inherit;
  font-size:.82rem;transition:all .12s;
}
.qb-actions button.primary{background:#a855f7;color:#fff;border-color:#a855f7}
.qb-actions button.primary:hover{background:#9333ea}
.qb-actions button:hover{background:rgba(168,85,247,.3);color:#fff}
.qb-pager{
  font-size:.72rem;color:#888;display:flex;align-items:center;
}

/* Input de renommage inline d'un onglet */
.tab-rename-input{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(74,108,247,.5);
  border-radius:4px;padding:.15rem .4rem;
  color:#e0e0e0;font-family:inherit;font-size:.82rem;
  outline:none;max-width:180px;
}

/* Menu contextuel sur les onglets */
.tab-ctx-menu{
  position:fixed;z-index:1000;
  background:#11141b;border:1px solid rgba(255,255,255,.12);
  border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.45);
  padding:.3rem;min-width:180px;
}
.tab-ctx-menu .ctx-item{
  padding:.4rem .65rem;border-radius:5px;cursor:pointer;
  font-size:.85rem;color:#cfd6e0;
}
.tab-ctx-menu .ctx-item:hover{background:rgba(74,108,247,.18);color:#fff}
.tab-ctx-menu .ctx-sep{
  height:1px;background:rgba(255,255,255,.08);margin:.3rem .2rem;
}

/* Bouton ✨ regen dans le picker */
.session-regen{
  background:none;border:none;color:#666;cursor:pointer;
  font-size:.9rem;line-height:1;padding:.15rem .3rem;border-radius:4px;
  opacity:0;transition:opacity .12s, color .12s, background .12s;
}
.session-item:hover .session-regen{opacity:1}
.session-regen:hover{color:#ffd86b;background:rgba(255,216,107,.12)}
.session-regen:disabled{opacity:.5;cursor:wait}
.session-title{display:flex;align-items:center;gap:.4rem}

/* Modal de renommage */
#renameModal .modal-body{display:flex;flex-direction:column;gap:.7rem}
#renameInput{
  width:100%;padding:.55rem .7rem;border-radius:6px;
  background:#11141b;color:#e1e3ea;
  border:1px solid rgba(255,255,255,.12);outline:none;
  font-family:inherit;font-size:.95rem;
}
#renameInput:focus{border-color:rgba(74,108,247,.55)}
.rename-actions{display:flex;align-items:center;gap:.4rem}
.rename-spacer{flex:1}
#renameGenerate.busy{opacity:.7;cursor:wait}
#renameGenerate.busy::before{content:"⏳ "}
.btn-primary{
  background:linear-gradient(135deg,#4a6cf7,#7a4af7);color:#fff;
  border:none;padding:.5rem 1rem;border-radius:7px;font-weight:700;
  cursor:pointer;font-size:.85rem;font-family:inherit;transition:filter .15s;
}
.btn-primary:hover{filter:brightness(1.12)}

/* Indicateur "messages plus anciens" en haut du chat (lazy load) */
.nv-load-more{
  align-self:stretch;
  display:flex;flex-direction:column;align-items:center;gap:.2rem;
  padding:.7rem 1rem;cursor:pointer;
  background:rgba(74,108,247,.05);
  border:1px dashed rgba(74,108,247,.25);
  border-radius:8px;margin-bottom:.4rem;
  color:#9ab0ff;font-size:.85rem;
  transition:background .12s;
}
.nv-load-more:hover{background:rgba(74,108,247,.12)}
.nv-load-more-hint{color:#666;font-size:.7rem}

/* Bouton flottant "retour en bas" : centré, juste au-dessus du composer */
.nv-scroll-bottom{
  position:absolute;left:50%;bottom:7.5rem;
  transform:translateX(-50%) scale(.95);
  background:rgba(20,22,30,.85);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  color:#cfd6e0;
  border:1px solid rgba(255,255,255,.12);
  cursor:pointer;font-size:.82rem;font-weight:500;font-family:inherit;
  padding:.4rem .9rem .4rem .75rem;border-radius:18px;
  box-shadow:0 6px 18px rgba(0,0,0,.35);
  opacity:0;pointer-events:none;
  display:inline-flex;align-items:center;gap:.4rem;
  transition:opacity .15s, transform .15s, color .12s, background .12s;
  z-index:5;
}
.nv-scroll-bottom::before{
  content:"↓";display:inline-flex;align-items:center;justify-content:center;
  width:18px;height:18px;border-radius:50%;
  background:rgba(74,108,247,.85);color:#fff;font-weight:700;font-size:.85rem;
}
.nv-scroll-bottom:hover{
  background:rgba(30,33,45,.95);color:#fff;
  transform:translateX(-50%) scale(1) translateY(-1px);
}
.nv-scroll-bottom.visible{
  opacity:1;pointer-events:auto;
  transform:translateX(-50%) scale(1);
}

/* Désactive le smooth scroll pour le saut initial vers le bas */
.native-stream{scroll-behavior:auto}

/* === GIT VIEW === */
.git-view{
  flex:1;display:none;flex-direction:column;
  background:rgba(0,0,0,.15);min-height:0;min-width:0;
}
.git-view.active{display:flex}

.git-header{
  display:flex;align-items:center;gap:.5rem;
  padding:.45rem .8rem;border-bottom:1px solid rgba(255,255,255,.08);
  background:rgba(10,10,12,.7);font-size:.85rem;color:#bbb;
  flex-shrink:0;position:relative;
}
.git-branch{
  font-family:'JetBrains Mono','Consolas',monospace;
  color:#a855f7;font-weight:600;
}
.git-branch::before{content:'\2387 ';opacity:.7}
.git-sync{color:#888;font-size:.78rem}
.git-actions{margin-left:auto;display:flex;gap:.4rem;position:relative;align-items:center}
.git-actions .btn-icon{padding:.25rem .5rem;font-size:.85rem}
.git-sync-btn{
  background:rgba(74,108,247,.18);color:#cfd8ff;
  border:1px solid rgba(74,108,247,.35);border-radius:6px;
  padding:.32rem .8rem;font-weight:600;font-size:.82rem;cursor:pointer;
  transition:all .15s;font-family:inherit;
}
.git-sync-btn:hover{background:rgba(74,108,247,.3);color:#fff;border-color:rgba(74,108,247,.55)}
.git-sync-btn:disabled,.git-sync-btn.busy{opacity:.55;cursor:wait}
.git-more-menu{
  position:absolute;top:calc(100% + .25rem);right:0;
  background:#15171c;border:1px solid rgba(255,255,255,.12);
  border-radius:6px;padding:.25rem;min-width:140px;z-index:40;
  display:flex;flex-direction:column;gap:.1rem;
  box-shadow:0 8px 24px rgba(0,0,0,.45);
}
.git-more-menu[hidden]{display:none}
.gmm-item{
  background:none;border:none;color:#ddd;
  text-align:left;padding:.4rem .55rem;border-radius:4px;
  font-size:.82rem;cursor:pointer;font-family:inherit;
}
.gmm-item:hover{background:rgba(74,108,247,.18);color:#fff}

/* Bouton "branche" cliquable dans le header git */
.git-branch-btn{
  background:none;border:1px solid transparent;
  display:flex;align-items:center;gap:.35rem;cursor:pointer;
  padding:.2rem .5rem;border-radius:5px;color:#a855f7;
  font-family:'JetBrains Mono','Consolas',monospace;font-weight:600;font-size:.85rem;
  transition:all .12s;
}
.git-branch-btn:hover{background:rgba(168,85,247,.12);border-color:rgba(168,85,247,.3);color:#fff}
.git-branch-btn .git-branch{color:inherit}
.git-branch-btn .git-branch::before{content:'\2387 ';opacity:.7}
.git-branch-caret{color:#888;font-size:.7rem}

/* Dropdown des branches */
.git-branches-menu{
  position:absolute;top:calc(100% + .25rem);left:.5rem;
  background:#15171c;border:1px solid rgba(255,255,255,.12);
  border-radius:6px;padding:.4rem;min-width:340px;max-width:560px;z-index:60;
  display:flex;flex-direction:column;gap:.3rem;
  box-shadow:0 12px 32px rgba(0,0,0,.55);
  max-height:60vh;
}
.git-branches-menu[hidden]{display:none}
.gbm-filter{
  background:rgba(0,0,0,.35);border:1px solid rgba(255,255,255,.1);
  border-radius:5px;padding:.35rem .5rem;color:#e6e6e6;font-size:.82rem;
  outline:none;font-family:inherit;
}
.gbm-filter:focus{border-color:rgba(168,85,247,.5);background:rgba(0,0,0,.5)}
.gbm-list{flex:1;overflow:auto;display:flex;flex-direction:column;gap:.05rem;font-size:.78rem;}
.gbm-loading,.gbm-empty{padding:.5rem;color:#888;font-style:italic;}
.gbm-item{
  display:grid;grid-template-columns:1rem 1fr auto;gap:.4rem;
  padding:.35rem .5rem;border-radius:4px;cursor:pointer;
  color:#bbb;align-items:center;
}
.gbm-item:hover{background:rgba(168,85,247,.14);color:#fff}
.gbm-item.current{background:rgba(168,85,247,.2);color:#fff;font-weight:600;}
.gbm-item.remote{color:#a8c0ff;}
.gbm-item .gbm-marker{font-size:.85rem;color:#a855f7;text-align:center;}
.gbm-item.remote .gbm-marker{color:#9ab0ff;}
.gbm-item .gbm-name{font-family:'JetBrains Mono','Consolas',monospace;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.gbm-item .gbm-meta{color:#666;font-size:.7rem;white-space:nowrap;}

.git-body{
  flex:1;display:flex;min-height:0;min-width:0;
}
.git-sidebar{
  width:340px;flex-shrink:0;
  display:flex;flex-direction:column;min-height:0;
  border-right:1px solid rgba(255,255,255,.08);
  background:rgba(10,10,12,.6);
}
.git-section{display:flex;flex-direction:column;min-height:0;}
.git-section-msg{flex-shrink:0;padding:.5rem;}
.git-section-changes{flex:1 1 0;min-height:0;overflow:hidden;}
.git-section-history{flex:1 1 0;min-height:0;overflow:hidden;border-top:1px solid rgba(255,255,255,.06);}
.git-section-head{
  font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;
  color:#666;padding:.4rem .6rem;
  border-bottom:1px solid rgba(255,255,255,.06);
  flex-shrink:0;
}
.git-msg-shell{
  display:flex;gap:.3rem;margin-bottom:.4rem;
}
.git-msg-shell input[type=text]{
  flex:1;background:rgba(0,0,0,.35);border:1px solid rgba(255,255,255,.1);
  border-radius:6px;padding:.4rem .55rem;color:#e6e6e6;
  font-size:.85rem;outline:none;min-width:0;
}
.git-msg-shell input[type=text]:focus{
  border-color:rgba(74,108,247,.55);background:rgba(0,0,0,.5);
}
.git-msg-shell .btn-icon.busy{opacity:.5;pointer-events:none}
.git-commit-actions{display:flex;gap:.4rem;}
.git-commit-actions .btn-primary,
.git-commit-actions .btn-secondary{flex:1;}
.git-commit-actions button[disabled]{opacity:.45;pointer-events:none;}
.git-files-list,
.git-history-list{
  flex:1;overflow:auto;padding:.2rem 0;font-size:.82rem;
  font-family:'JetBrains Mono','Consolas',monospace;
}
.git-history-item{
  font-family:'JetBrains Mono','Consolas',monospace;font-size:.75rem;
  color:#bbb;border-left:2px solid transparent;
}
.git-history-item .ghi-header{
  padding:.25rem .6rem;cursor:pointer;
  display:flex;gap:.4rem;align-items:center;
  white-space:nowrap;overflow:hidden;
}
.git-history-item .ghi-header:hover{background:rgba(255,255,255,.04);color:#fff;}
.git-history-item .ghi-arrow{flex-shrink:0;color:#666;font-size:.7rem;width:.7rem;}
.git-history-item .ghi-sha{color:#a855f7;flex-shrink:0;}
.git-history-item .ghi-subject{overflow:hidden;text-overflow:ellipsis;flex:1;}
.git-history-item.head{border-left-color:#4a6cf7;font-weight:600;}
.git-history-item.expanded{background:rgba(255,255,255,.02);}
.git-history-item .ghi-files{padding:.1rem 0;}
.git-history-item:not(.expanded) .ghi-files{display:none;}
.git-history-item .ghi-file{
  padding:.18rem .6rem .18rem 1.8rem;cursor:pointer;
  display:flex;gap:.4rem;align-items:center;
  font-size:.72rem;color:#999;
  white-space:nowrap;overflow:hidden;
}
.git-history-item .ghi-file:hover{background:rgba(255,255,255,.05);color:#fff;}
.git-history-item .ghi-file.active{background:rgba(74,108,247,.18);color:#fff;}
.git-history-item .ghi-file .ghi-status{
  font-size:.6rem;padding:0 .2rem;border-radius:2px;flex-shrink:0;
  background:rgba(255,255,255,.06);color:#aaa;
}
.git-history-item .ghi-file-a .ghi-status{background:rgba(74,222,128,.18);color:#4ade80;}
.git-history-item .ghi-file-m .ghi-status{background:rgba(74,108,247,.18);color:#9ab0ff;}
.git-history-item .ghi-file-d .ghi-status{background:rgba(231,76,60,.18);color:#f87171;}
.git-history-item .ghi-file-r .ghi-status{background:rgba(243,156,18,.18);color:#f5a623;}
.git-history-item .ghi-file .ghi-path{overflow:hidden;text-overflow:ellipsis;flex:1;}
.git-history-item .ghi-file .ghi-add{color:#4ade80;font-size:.66rem;flex-shrink:0;}
.git-history-item .ghi-file .ghi-del{color:#f87171;font-size:.66rem;flex-shrink:0;}
.git-history-item .ghi-loading,
.git-history-item .ghi-empty{padding:.3rem .6rem 0 1.8rem;color:#666;font-style:italic;font-size:.7rem;}
.git-section-title{
  padding:.3rem .6rem;font-size:.7rem;text-transform:uppercase;
  letter-spacing:.05em;color:#666;border-top:1px solid rgba(255,255,255,.04);
}
.git-section-title:first-child{border-top:0}
.git-file-item{
  display:flex;align-items:center;gap:.35rem;
  padding:.2rem .55rem;cursor:pointer;color:#bbb;
  border-left:2px solid transparent;
  white-space:nowrap;user-select:none;
}
.git-file-item:hover{background:rgba(255,255,255,.04);color:#fff}
.git-file-item.active{
  background:rgba(74,108,247,.15);border-left-color:#4a6cf7;color:#fff;
}
.git-file-item.staged{background:rgba(34,139,87,.08)}
.git-file-item input[type=checkbox]{flex-shrink:0;cursor:pointer}
.git-file-item .gfi-path{overflow:hidden;text-overflow:ellipsis;flex:1;font-size:.78rem}
.git-file-item .gfi-add{color:#4ade80;font-size:.72rem}
.git-file-item .gfi-del{color:#f87171;font-size:.72rem}
.git-file-item .gfi-status{
  font-size:.65rem;opacity:.7;padding:0 .25rem;border-radius:3px;
}
.git-file-item.untracked .gfi-status{color:#f5a623}
.git-file-item.deleted .gfi-path{text-decoration:line-through;color:#888}

.git-diff-pane{
  flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;
  position:relative;
}
.git-diff-host{flex:1;min-height:0}

.git-amend-toggle{
  display:flex;align-items:center;gap:.3rem;color:#bbb;font-size:.8rem;cursor:pointer;
  user-select:none;margin-bottom:.4rem;
}

.git-terminal-divider{
  height:6px;cursor:row-resize;
  background:rgba(255,255,255,.04);
  border-top:1px solid rgba(255,255,255,.06);
  border-bottom:1px solid rgba(255,255,255,.06);
  flex-shrink:0;
}
.git-terminal-divider:hover{background:rgba(74,108,247,.25)}
.git-sidebar-divider{
  width:5px;flex-shrink:0;cursor:col-resize;
  background:rgba(255,255,255,.03);
  transition:background .12s;
}
.git-sidebar-divider:hover,.git-sidebar-divider.dragging{background:rgba(74,108,247,.5)}
.git-history-divider{
  height:5px;flex-shrink:0;cursor:row-resize;
  background:rgba(255,255,255,.03);
  transition:background .12s;
}
.git-history-divider:hover,.git-history-divider.dragging{background:rgba(74,108,247,.5)}
.git-terminal-host{
  height:220px;min-height:60px;
  background:#0a0a0c;padding:.3rem;
  flex-shrink:0;overflow:hidden;
}

.git-empty{
  display:none;flex:1;
  flex-direction:column;align-items:center;justify-content:center;
  gap:1rem;color:#888;padding:2rem;text-align:center;
}
.git-view.empty .git-body{display:none}
.git-view.empty .git-empty{display:flex}
.git-view.empty .git-header .git-actions{display:none}
.git-view.empty .git-branch{color:#888;font-weight:400}

.git-init-visibility{
  border:0;padding:.4rem 0;display:flex;gap:1rem;color:#bbb;font-size:.85rem;
}
.git-init-visibility label{display:flex;align-items:center;gap:.3rem;cursor:pointer}

.tab.tab-pinned.tab-git{color:#9ed29e}
.tab.tab-pinned.tab-git.active{
  background:rgba(74,222,128,.14);border-color:rgba(74,222,128,.3);color:#fff;
}
