/* ============================================================================
   PANEL AGENTA — boczny komponent po prawej (flex, nie overlay). Otwarcie
   zwęża resztę aplikacji (body.agent-open). Ikona agenta w toolbarach.
   ============================================================================ */
.agent-panel{
  width:var(--agent-w,420px);flex:0 0 auto;min-width:0;position:relative;
  display:flex;flex-direction:column;
  background:var(--card);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;
}
.agent-panel[hidden]{display:none}
body.app-reveal .agent-panel{animation:riseIn .35s ease backwards}

/* zwężenie reszty strony: główny widok Studia „wylewa się" ujemnym marginesem
   do krawędzi ekranu — przy otwartym panelu wraca do siatki */
body.agent-open .main{margin-right:0;padding-right:0}
/* pływające okno promptu Studia nie może wchodzić pod panel */
body.agent-open .prompt-container{right:calc(var(--agent-w,420px) + 30px)}
body.agent-resizing{cursor:col-resize;user-select:none}
body.agent-resizing .agent-panel,body.agent-resizing .main{transition:none}

.ap-resizer{
  position:absolute;left:0;top:0;bottom:0;width:7px;cursor:col-resize;z-index:5;
  transition:background .15s ease;
}
.ap-resizer:hover{background:rgba(139,92,246,.35)}
body.agent-resizing .ap-resizer{background:rgba(139,92,246,.5)}

.ap-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  height:52px;padding:0 10px 0 16px;border-bottom:1px solid #21252C;flex-shrink:0;
}
.ap-head-l{display:flex;align-items:center;gap:9px;min-width:0}
.ap-badge{
  width:26px;height:26px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex:0 0 auto;
  background:linear-gradient(135deg,rgba(139,92,246,.28),rgba(76,159,255,.14));border:1px solid rgba(139,92,246,.5);color:#C4ACFF;
}
.ap-badge svg{width:13px;height:13px}
.ap-title{font-size:11px;font-weight:800;letter-spacing:.14em;color:var(--text-soft);white-space:nowrap}
.ap-sel{
  min-width:0;max-width:190px;height:30px;background:#0F1216;border:1px solid var(--border);border-radius:7px;
  color:var(--text-soft);font-size:12px;font-family:inherit;padding:0 8px;outline:none;text-overflow:ellipsis;
}
.ap-sel:focus{border-color:rgba(139,92,246,.7)}
.ap-actions{display:flex;align-items:center;gap:2px;flex-shrink:0}
.ap-btn{
  width:30px;height:30px;border-radius:7px;display:flex;align-items:center;justify-content:center;color:var(--dim);
  transition:color .13s ease,background .13s ease;
}
.ap-btn svg{width:16px;height:16px}
.ap-btn:hover{color:#fff;background:rgba(255,255,255,.06)}
.ap-thread{flex:1;min-height:0;display:flex;flex-direction:column}

/* --- ikona agenta w toolbarach: lekko wyodrębniona (fiolet + iskra) --- */
.ap-launch{
  width:36px;height:36px;flex:0 0 auto;border-radius:8px;margin-left:4px;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,rgba(139,92,246,.2),rgba(76,159,255,.1));
  border:1px solid rgba(139,92,246,.55);color:#B79CFF;
  box-shadow:0 0 0 0 rgba(139,92,246,0);
  transition:color .15s ease,border-color .15s ease,background .15s ease,box-shadow .2s ease,transform .15s ease;
}
.ap-launch svg{width:16px;height:16px}
.ap-launch:hover{color:#fff;border-color:#A78BFA;background:linear-gradient(135deg,rgba(139,92,246,.35),rgba(76,159,255,.18));box-shadow:0 0 0 3px rgba(139,92,246,.14)}
.ap-launch.active{color:#fff;background:linear-gradient(135deg,#8B5CF6,#4C9FFF);border-color:transparent;box-shadow:0 6px 18px rgba(139,92,246,.35)}
.ap-launch.ap-float{position:absolute;top:14px;right:16px;z-index:30}
/* toolbar Notatnika ma mniejsze przyciski — ikona agenta trzyma ich wysokość */
.nt-head-actions .ap-launch{width:32px;height:32px}

/* --- płynne wysuwanie / chowanie panelu agenta --- */
.agent-panel{
  width:0;opacity:0;border-width:0;
  transition:width .32s cubic-bezier(.22,.8,.24,1),opacity .22s ease,border-width 0s linear .32s;
  will-change:width;
}
body.agent-open .agent-panel{width:var(--agent-w,420px);opacity:1;border-width:1px;transition:width .32s cubic-bezier(.22,.8,.24,1),opacity .2s ease .08s}
.agent-panel > *:not(.ap-resizer){min-width:var(--agent-w,420px)}
.agent-panel > .ap-resizer{min-width:0;width:7px}
body.app-reveal .agent-panel{animation:none}
.prompt-container{transition:right .32s cubic-bezier(.22,.8,.24,1)}

/* selektor modelu w nagłówku panelu — ciasno, więc mniejsze pigułki, węższy wybór rozmowy */
.ap-model{flex-shrink:0}
.ap-model .ct-model-opt{height:22px;padding:0 7px;font-size:9.5px}
.ap-head .ap-sel{max-width:170px}
/* wąski panel: napis „AGENT" ustępuje miejsca wyborowi rozmowy i modelu (ikona zostaje) */
.agent-panel{container-type:inline-size}
@container (max-width: 460px){ .ap-head .ap-title{display:none} }
