/* 
==========================================
AI DOCK SYSTEM (Neuromorphic + Border Beam)
==========================================
*/

@property --pt-dock-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* Bottom Controls Wrapper */
.pt-ai-dock-wrapper {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  max-width: 750px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  z-index: 1999999;
  pointer-events: none;

  /* La composition entière — conversation, décision, champ — tient dans
     l'écran. Le dock grandit avec ce qu'il faut valider ; sans plafond ici,
     un plan de vingt tâches poussait la conversation hors du viewport. */
  max-height: calc(92vh - 1.5rem);
}

.pt-ai-dock-wrapper>* {
  pointer-events: auto;
}

/* Response Zone (Dark Glass Full Popup) */
.pt-ai-response-zone {
  position: relative;
  bottom: auto;
  margin-bottom: 15px;
  width: 100%;
  height: 75vh;
  min-height: 0;
  /* c'est elle qui cède quand le dock grandit */
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  opacity: 0;
  transform: scale(0.95) translate(0, 40px);
  transform-origin: bottom center;
  pointer-events: none;
  transition:
    transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 0.3s ease,
    height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.5),
    0 15px 35px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pt-ai-response-zone.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

#pt-ai-response-zone.pt-ai-has-previews {
  height: calc(75vh - 122px) !important;
  max-height: calc(800px - 122px) !important;
}

/* Main Tabs Navigation */
.pt-ai-main-tabs-nav {
  display: flex;
  gap: 0.65rem !important;
  overflow-x: auto;
}

.pt-ai-main-tab-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.pt-ai-main-tab-btn.active {
  color: var(--aura-neon, #ff6a00);
  border-bottom-color: var(--aura-neon, #ff6a00);
}

/* Tabs Content Containers */
.pt-ai-main-tab-content {
  display: none;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.pt-ai-main-tab-content.active {
  display: flex;
  animation: pt-tab-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#pt-ai-tab-plan,
#pt-ai-tab-results,
#pt-ai-tab-files {
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  width: 100%;
}

@keyframes pt-tab-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pt-ai-response-zone.danger {
  border-color: #ef4444;
  box-shadow: 0 30px 60px rgba(239, 68, 68, 0.08), inset 0 0 0 1px rgba(239, 68, 68, 0.1);
}

.pt-ai-response-zone.danger .pt-ai-response-header h4 {
  color: #dc2626;
}

.pt-ai-response-zone.danger .pt-ai-response-header i,
.pt-ai-response-zone.danger .pt-ai-response-header svg {
  color: #ef4444;
}

.pt-ai-response-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding-bottom: 0 !important;
}








.pt-ai-response-header h4 {
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 900;
  margin: 0;
}

.pt-ai-response-header .pt-ai-response-close {
  margin-left: auto !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  cursor: pointer;
  padding: 4px;
  border-radius: 9999px !important;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pt-ai-response-header .pt-ai-response-close:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}

.pt-ai-response-content {
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.5s ease 0.35s;
}

.pt-ai-response-content strong {
  color: #0f172a;
  font-weight: 700;
}

.pt-ai-response-zone.visible .pt-ai-response-content {
  opacity: 1;
  transform: translateY(0);
}

.pt-ai-response-actions {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.pt-ai-response-actions button {
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pt-ai-response-actions .pt-ai-resp-btn-primary {
  background: var(--aura-neon, #ff6a00);
  color: white;
  border: none;
}

.pt-ai-response-actions .pt-ai-resp-btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.pt-ai-response-actions .pt-ai-resp-btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  color: #475569;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.pt-ai-response-actions .pt-ai-resp-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Dock Outer Container (Border Beam) */
.pt-ai-dock-outer {
  padding: 4px;
  border-radius: 100px;
  position: relative;
  background: #0f0f14;
  box-shadow:
    0 0 40px rgba(var(--primary-rgb, 217, 119, 6), 0.15),
    15px 15px 30px rgba(0, 0, 0, 0.6),
    -8px -8px 30px rgba(255, 255, 255, 0.015),
    inset 6px 6px 12px rgba(0, 0, 0, 0.8),
    inset -3px -3px 10px rgba(255, 255, 255, 0.01);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.pt-ai-dock-outer:hover {
  transform: scale(1.015);
  box-shadow:
    0 0 60px rgba(var(--primary-rgb, 217, 119, 6), 0.25),
    15px 15px 40px rgba(0, 0, 0, 0.7);
}

/* Rotating Border Beam */
.pt-ai-dock-outer::after {
  content: '';
  position: absolute;
  inset: 0;
  padding: 3px;
  border-radius: 100px;
  background: conic-gradient(from var(--pt-dock-angle),
      transparent 40%,
      var(--primary, #d97706),
      rgba(var(--primary-rgb, 217, 119, 6), 0.6),
      var(--primary, #d97706),
      transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: pt-dock-rotate-beam 3s linear infinite;
  pointer-events: none;
  opacity: 0.8;
  /* Le contour suit le dock quand il se déplie, au lieu de sauter d'une forme à l'autre. */
  transition: opacity 0.3s ease, border-radius 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.pt-ai-dock-outer:hover::after {
  opacity: 1;
}

/* When the response popup is open, pause the rotating border beam animation */
.pt-ai-dock-wrapper.active-popup .pt-ai-dock-outer::after {
  animation-play-state: paused !important;
}

/* Reactivate the animation ONLY if the pause/stop button is active/visible (en chargement) */
.pt-ai-dock-wrapper.active-popup .pt-ai-dock-outer:has(#pt-ai-chat-stop.flex)::after,
.pt-ai-dock-wrapper.active-popup .pt-ai-dock-outer:has(#pt-ai-chat-stop:not(.hidden))::after {
  animation-play-state: running !important;
}

@keyframes pt-dock-rotate-beam {
  to {
    --pt-dock-angle: 360deg;
  }
}

/* Dock Inner (Glass Pill) */
.pt-ai-dock {
  flex: 1;
  background: rgba(15, 15, 20, 0.6);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 100px;
  padding: 10px 10px 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    8px 8px 16px rgba(0, 0, 0, 0.5),
    -4px -4px 12px rgba(255, 255, 255, 0.015),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.pt-ai-dock.thinking .pt-ai-dock-input {
  opacity: 0.3;
  pointer-events: none;
}

.pt-ai-dock.danger {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.2), 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Spark Button */
.pt-ai-dock-spark {
  background: linear-gradient(135deg, var(--primary, #d97706), rgba(var(--primary-rgb, 217, 119, 6), 0.7));
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(var(--primary-rgb, 217, 119, 6), 0.4);
  flex-shrink: 0;
  animation: pt-dock-spark-pulse 2.5s infinite ease-in-out;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  color: white;
  position: relative !important;
  overflow: hidden !important;
}

.pt-ai-dock-spark .spark-icon-sparkles,
.pt-ai-dock-spark .spark-icon-plus {
  position: absolute !important;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
}

.pt-ai-dock-spark .spark-icon-plus {
  opacity: 0 !important;
  transform: scale(0.5) rotate(-90deg) !important;
}

.pt-ai-dock-spark .spark-icon-sparkles {
  opacity: 1 !important;
  transform: scale(1) rotate(0deg) !important;
}

.pt-ai-dock-spark:hover,
.pt-ai-dock-spark.hovered {
  transform: scale(1.1) !important;
  background: linear-gradient(135deg, #f97316, #ff7e1a) !important;
}

.pt-ai-dock-spark:hover .spark-icon-sparkles,
.pt-ai-dock-spark.hovered .spark-icon-sparkles {
  opacity: 0 !important;
  transform: scale(0.4) rotate(90deg) !important;
}

.pt-ai-dock-spark:hover .spark-icon-plus,
.pt-ai-dock-spark.hovered .spark-icon-plus {
  opacity: 1 !important;
  transform: scale(1) rotate(0deg) !important;
}

@keyframes pt-ai-spark-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 18px rgba(var(--primary-rgb, 217, 119, 6), 0.4);
  }

  50% {
    transform: scale(1.06);
    box-shadow: 0 0 30px rgba(var(--primary-rgb, 217, 119, 6), 0.6);
  }
}

/* Dock Input */
.pt-ai-dock-input {
  background: transparent;
  border: none;
  flex: 1;
  color: white;
  outline: none;
  padding: 0 0.75rem;
  font-size: 0.95rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  min-width: 0;
  transition: opacity 0.3s ease;
}

.pt-ai-dock-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 300;
}

.pt-ai-dock-input:focus::placeholder {
  color: rgba(255, 255, 255, 0.15);
}

/* Dock Send Button */
.pt-ai-dock-send {
  background: linear-gradient(135deg, var(--primary, #d97706), rgba(var(--primary-rgb, 217, 119, 6), 0.8)) !important;
  border: none !important;
  color: white !important;
  cursor: pointer !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 0 15px rgba(var(--primary-rgb, 217, 119, 6), 0.3) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex-shrink: 0 !important;
}

.pt-ai-dock-send:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 0 22px rgba(var(--primary-rgb, 217, 119, 6), 0.5) !important;
}

/* Dock Stop / Loader Button */
.pt-ai-dock-stop {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 2px solid rgba(255, 255, 255, 0.08) !important;
  color: #f43f5e !important;
  /* Rose-500 color for pause icon */
  cursor: pointer !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  border-radius: 50% !important;
  display: none;
  /* Controlled by jQuery show/hide */
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  transition: all 0.3s ease !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
}

.pt-ai-dock-stop.flex {
  display: flex !important;
}

.pt-ai-dock-send.hidden,
.pt-ai-dock-stop.hidden {
  display: none !important;
}

.pt-ai-dock-stop:hover {
  background: rgba(244, 63, 94, 0.1) !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
  color: #fda4af !important;
  /* Rose-300 on hover */
  transform: scale(1.05) !important;
}

.pt-ai-loader-circle {
  position: absolute !important;
  inset: -2px !important;
  border: 2px solid transparent !important;
  border-top: 2px solid #f43f5e !important;
  /* Rose spinner border */
  border-radius: 50% !important;
  animation: pt-ai-spin 1.2s linear infinite !important;
}

@keyframes pt-ai-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Think Mode (Send Button) */
.pt-ai-dock-send.thinking {
  background: var(--primary, #d97706);
  pointer-events: none;
  animation: pt-ai-send-pulse 1.5s infinite ease-in-out;
}

@keyframes pt-ai-send-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 217, 119, 6), 0.5);
  }

  50% {
    transform: scale(1.12);
    box-shadow: 0 0 20px 8px rgba(var(--primary-rgb, 217, 119, 6), 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 217, 119, 6), 0);
  }
}

.pt-ai-dock-send.thinking.danger {
  background: #ef4444;
  animation: pt-dock-think-danger 1.5s ease-in-out infinite;
}

@keyframes pt-dock-think-danger {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }

  50% {
    transform: scale(1.12);
    box-shadow: 0 0 20px 8px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Voice Interaction Pulse Mode */
#pt-ai-voice-btn.active {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  animation: pt-voice-pulse 1.5s infinite;
}

@keyframes pt-voice-pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

/* Response Zone Scrollbar */
.pt-ai-response-zone::-webkit-scrollbar {
  width: 4px;
}

.pt-ai-response-zone::-webkit-scrollbar-track {
  background: transparent;
}

.pt-ai-response-zone::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .pt-ai-dock-wrapper {
    width: 92%;
    bottom: max(1rem, env(safe-area-inset-bottom, 0.5rem));
  }

  .pt-ai-dock-wrapper.active-popup {
    position: fixed !important;
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    transform: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: center !important;
    padding-bottom: 8px !important;
    z-index: 1999999 !important;
  }

  .pt-ai-dock-input {
    font-size: 0.85rem;
  }

  .pt-ai-dock-spark {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .pt-ai-response-zone {
    max-height: 50vh;
    padding: 1.2rem 1.5rem;
    border-radius: 20px;
  }

  #pt-ai-response-zone.pt-ai-has-previews {
    height: calc(50vh - 122px) !important;
    max-height: calc(50vh - 122px) !important;
  }

  /* Clavier ouvert : la zone visible rétrécit, la conversation aussi (même principe que les pièces jointes) */
  #pt-ai-response-zone.pt-ai-keyboard-open {
    height: calc(var(--pt-visual-viewport-height, 100vh) - var(--pt-ai-dock-h, 72px) - 40px) !important;
    max-height: calc(var(--pt-visual-viewport-height, 100vh) - var(--pt-ai-dock-h, 72px) - 40px) !important;
  }
}

/* Hide dock when offcanvas chat is open */
.pt-offcanvas-open .pt-ai-dock-wrapper {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 
==========================================
AI CHAT WIDGET
==========================================
*/
#pt-ai-chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.pt-ai-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(18, 18, 18, 0.65);
  backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: none !important;
  color: #fff;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pt-ai-fab.in-header {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  /* User requested no shadow */
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  cursor: pointer;
  transition: all 0.3s var(--ease-premium);
}

.pt-ai-fab.in-header:hover {
  transform: scale(1.1) rotate(12deg);
}

.pt-ai-fab.in-header .pt-ai-orb {
  inset: 2px;
  filter: blur(6px);
  /* More localized animation */
  animation: orb-rotate 4s linear infinite;
  background: conic-gradient(from 0deg, #10b981, #3b82f6, #8b5cf6, #10b981);
  position: absolute;
  border-radius: 50%;
  z-index: 1;
  opacity: 0.8;
}

@keyframes orb-rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Status Dynamics: Icon only */
.pt-ai-fab.status-green i,
.pt-ai-fab[data-status="green"] i,
.pt-ai-fab.status-green svg,
.pt-ai-fab[data-status="green"] svg {
  color: #10b981 !important;
}

.pt-ai-fab.status-orange i,
.pt-ai-fab[data-status="orange"] i,
.pt-ai-fab.status-orange svg,
.pt-ai-fab[data-status="orange"] svg {
  color: #f59e0b !important;
}

.pt-ai-fab.status-red i,
.pt-ai-fab[data-status="red"] i,
.pt-ai-fab.status-red svg,
.pt-ai-fab[data-status="red"] svg {
  color: #ef4444 !important;
}

/* Reset button styling to be neutral */
.pt-ai-fab.in-header {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.pt-ai-fab.in-header:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.1);
}

.pt-ai-fab.in-header i,
.pt-ai-fab.in-header svg {
  width: 14px;
  height: 14px;
}

.pt-ai-fab.in-header:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Ensure the widget doesn't hide behind header when relative */
#pt-ai-chat-widget.active {
  position: fixed;
}

/* Lateral Offcanvas Chat Wrapper */
#pt-ai-chat-offcanvas {
  position: fixed;
  inset: 0;
  z-index: 2000000;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.4s;
}

#pt-ai-chat-offcanvas.active {
  pointer-events: auto;
  visibility: visible;
}

#pt-ai-chat-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: -1;
  /* Placé derrière la fenêtre de chat */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#pt-ai-chat-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.pt-ai-window {
  width: 100%;
  max-width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.7) !important;
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.5);
  z-index: 2;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), width 0.4s var(--ease-premium);
  transform: translateX(100%);
}

#pt-ai-chat-offcanvas.active .pt-ai-window {
  transform: translateX(0);
}

@media (min-width: 1024px) {
  .pt-ai-window {
    width: 30vw;
    min-width: 650px;
    max-width: 700px;
    transition: width 0.4s var(--ease-premium);
  }

  /* Precise expansion to avoid cropping */
  .pt-ai-window.pt-ai-has-sessions:not(.pt-ai-sessions-collapsed) {
    width: calc(650px + 260px);
    max-width: 1000px;
  }

  .pt-ai-window.pt-ai-has-logs {
    width: calc(650px + 400px);
    max-width: 1100px;
  }

  .pt-ai-window.pt-ai-has-sessions:not(.pt-ai-sessions-collapsed).pt-ai-has-logs {
    width: calc(650px + 260px + 400px);
    max-width: 95vw;
  }
}

.pt-ai-window,
.pt-ai-sessions-column,
.pt-ai-log-column {
  transition: all 0.4s var(--ease-premium) !important;
}

.pt-ai-window.pt-ai-instant-open,
.pt-ai-window.pt-ai-instant-open .pt-ai-log-column,
.pt-ai-window.pt-ai-instant-open .pt-ai-chat-column {
  transition: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important;
}

/* Mobile Priority (<1024px) */
@media (max-width: 1023px) {
  .pt-ai-window {
    position: fixed !important;
    top: var(--pt-visual-viewport-offset, 0) !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--pt-visual-viewport-height, 100dvh) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    transform: translateY(0) !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Chat column is always 100% on mobile */
  .pt-ai-chat-column {
    min-width: 100vw !important;
    flex: 1 1 100% !important;
  }

  /* Sheet Handle Style */
  .pt-ai-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 12px auto 4px auto;
    flex: none;
  }

  /* Sidebars become Bottom Sheets */
  .pt-ai-sessions-column,
  .pt-ai-log-column {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: 85vh !important;
    z-index: 2000 !important;
    background: rgba(15, 15, 20, 0.95) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    border-radius: 32px 32px 0 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-bottom: none !important;
    box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    /* Always flex but translated */
    transform: translateY(110%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
    pointer-events: none;
  }

  /* Active State for Sheets */
  #pt-ai-sessions-sidebar:not(.collapsed),
  .pt-ai-window.pt-ai-has-logs .pt-ai-log-column {
    transform: translateY(0) !important;
    pointer-events: all !important;
  }

  /* Ensure chat stays visible behind sheets */
  .pt-ai-body-wrapper {
    position: relative;
    overflow: hidden;
  }

  /* Sticky Header for Chat on Mobile */
  .pt-ai-chat-column .pt-ai-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: rgba(21, 21, 31, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  }
}

/* --- 3-Column Layout & Sidebars --- */
.pt-ai-body-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
  /* Context for mobile absolute sidebars */
}

.pt-ai-sessions-column {
  flex: none;
  width: 260px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.pt-ai-sessions-column.collapsed {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

.pt-ai-chat-column {
  flex: 1;
  min-width: 650px;
  /* Force minimum chat space to prevent cropping */
}

/* Session Items */
.pt-ai-session-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  border-radius: 16px !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  position: relative !important;
  overflow: hidden !important;
  width: calc(100% - 12px) !important;
  margin: 6px !important;
}

.pt-ai-session-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-1px);
}

.pt-ai-session-item.active {
  background: rgba(var(--aura-neon-rgb), 0.12) !important;
  border-color: var(--aura-neon) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 0 15px rgba(var(--aura-neon-rgb), 0.1) !important;
}

.pt-ai-session-content {
  flex: 1;
  min-width: 0;
  /* Crucial for truncation */
  display: flex;
  flex-direction: column;
}

.pt-ai-session-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.pt-ai-session-title-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.pt-ai-session-title-text {
  font-weight: 700 !important;
  color: #fff !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px !important;
  letter-spacing: -0.01em;
}

.pt-ai-session-item.active .pt-ai-session-title-text {
  color: #fff !important;
  text-shadow: 0 0 15px rgba(var(--aura-neon-rgb), 0.4);
}

.pt-ai-session-id {
  font-size: 8px;
  font-family: var(--font-mono);
  opacity: 0.15;
  flex-shrink: 0;
}

.pt-ai-session-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.6;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px !important;
}

.pt-ai-session-item.active .pt-ai-session-meta {
  opacity: 0.9;
  color: var(--aura-neon) !important;
}

.pt-ai-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pt-ai-meta-item svg,
.pt-ai-meta-item i {
  width: 11px;
  height: 11px;
}

.pt-ai-session-item.active .pt-ai-meta-item i {
  color: var(--aura-neon) !important;
}

.pt-ai-session-delete {
  flex-shrink: 0 !important;
  display: none !important;
  padding: 6px !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  width: 28px !important;
  height: 28px !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.3) !important;
}

.pt-ai-session-item:hover .pt-ai-session-delete {
  display: flex !important;
}

.pt-ai-session-delete:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
}

/* Scrollbar Minimal */
.custom-scrollbar-minimal::-webkit-scrollbar {
  width: 3px;
}

.custom-scrollbar-minimal::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar-minimal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.custom-scrollbar-minimal:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

.pt-ai-header {
  background: rgba(10, 10, 15, 0.6) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 16px !important;
  position: sticky;
  top: 0;
  z-index: 10;
}

.pt-ai-header .flex.items-center.gap-2 {
  gap: 8px !important;
}

/* Tighten title block further */
.pt-ai-header h2 {
  line-height: 1 !important;
  margin-bottom: 2px !important;
}

.pt-ai-header .relative.-mt-1\.5 {
  margin-top: -6px !important;
}

.pt-ai-status-indicator {
  transition: all 0.3s ease;
  box-shadow: none !important;
}

.pt-ai-status-indicator.status-green {
  background-color: #10b981;
}

.pt-ai-status-indicator.status-orange {
  background-color: #f59e0b;
}

/* Sessions Loader & Pagination */
.pt-ai-sessions-loader {
  padding: 12px;
  margin: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  animation: pt-pulse-skeleton 1.5s infinite ease-in-out;
}

@keyframes pt-pulse-skeleton {
  0% {
    opacity: 0.3;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.6;
    transform: scale(1);
  }

  100% {
    opacity: 0.3;
    transform: scale(0.98);
  }
}

.pt-ai-pagination-btn {
  flex: 1;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pt-ai-pagination-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

.pt-ai-pagination-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.pt-ai-page-info {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.2);
  text-align: center;
  min-width: 60px;
}

.pt-ai-status-indicator.status-red {
  background-color: #ef4444;
}

/* Progress Bar Styles */
.pt-ai-stat-row .h-1\.5,
.pt-ai-stat-row .h-1 {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  /* Continuous fluid decay */
}

#bar-rpd {
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

#bar-tpm {
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.3);
}

#bar-rpm {
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

#bar-ctx {
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* Progress Bar States */
.bar-low {
  opacity: 0.8;
}

.bar-mid {
  opacity: 1;
  filter: saturate(1.2);
}

.bar-high {
  filter: saturate(1.5) brightness(1.2);
}

.pt-ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.pt-ai-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
}

.relative.mt-0 {
  line-height: normal;
  /* Restore for the container */
  margin-top: -6px !important;
  /* Force tight grouping */
}

/* --- MODEL SWITCHER SELECT --- */
#pt-ai-model-switcher {
  transition: all 0.3s var(--ease-premium);
  padding-right: 18px !important;
  line-height: 1 !important;
  height: auto !important;
  margin: 0 !important;
}

#pt-ai-model-switcher optgroup,
#pt-ai-model-switcher option {
  background: #1a1a25;
  color: white;
}

#pt-ai-model-switcher:hover {
  color: #fb923c !important;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.pt-ai-chat-column {
  flex: 0 0 650px;
  width: 650px;
  min-width: 650px;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.pt-ai-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px 20px !important;
  /* Large bottom padding */
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.pt-ai-content::-webkit-scrollbar {
  width: 4px;
}

.pt-ai-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.pt-ai-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: ptAiMsgIn 0.3s ease-out forwards;
}

.pt-ai-message.ai {
  align-self: flex-start;
}

.pt-ai-message.user {
  align-self: flex-end;
}

.pt-ai-msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #fff;
  font-family: "Inter", "Poppins", sans-serif;
}

.pt-ai-message.ai .pt-ai-msg-bubble {
  /* background et box-shadow : aura-nextgen.css (ils doivent rester après les
     règles .quota-error ci-dessous, qu'ils recouvrent aujourd'hui). */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-left-radius: 4px;
  color: rgba(255, 255, 255, 0.95);
  min-width: 350px;
  /* Aura Stability Fix */
}

.pt-ai-message.user .pt-ai-msg-bubble {
  background: var(--pt-primary, #3b82f6);
  border: none;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(var(--pt-primary-rgb, 59, 130, 246), 0.3);
}

.pt-ai-footer {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

#pt-ai-chat-input {
  flex: 1;
  padding: 12px 39px 12px 16px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
}


#pt-ai-chat-send {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

#pt-ai-chat-send:not(:disabled):hover {
  background: rgba(255, 60, 0, 0.8);
  transform: scale(1.05);
}

#pt-ai-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes ptAiMsgIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pt-ai-typing {
  display: flex;
  gap: 4px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  border-top-left-radius: 4px;
  width: fit-content;
}

.pt-ai-typing div {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: ptTyping 1.4s infinite ease-in-out both;
}

.pt-ai-typing div:nth-child(1) {
  animation-delay: -0.32s;
}

.pt-ai-typing div:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes ptTyping {

  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.3;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- COMPACT & CONDENSED BUBBLE FOOTER OVERRIDES --- */
.pt-ai-message.ai .pt-ai-msg-bubble:has(.pt-ai-bubble-footer) {
  padding-bottom: 10px !important;
}

.pt-ai-bubble-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-top: 8px !important;
  padding-top: 0 !important;
  border-top: none !important;
}

.pt-ai-response-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  margin-top: 0 !important;
  /* Reset any legacy margins */
  padding-top: 0 !important;
  /* Reset any legacy paddings */
  border-top: none !important;
  /* Reset any legacy borders */
}

/* Pied de réponse placé sur la ligne de l'émetteur (AURA), aligné à droite */
.pt-ai-bubble-footer.pt-ai-bubble-footer-inline {
  gap: 6px !important;
  min-width: 0;
}

.pt-ai-bubble-footer-inline+.pt-ai-toggle-thoughts-btn {
  margin-left: 4px;
}

/* Neutralize legacy button styles and make actions gorgeous and perfectly sized */
.pt-ai-response-actions .pt-ai-btn-action {
  width: 22px !important;
  height: 22px !important;
  padding: 0 !important;
  border-radius: 5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.5) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  min-width: 0 !important;
  /* Reset any legacy min-width */
  line-height: normal !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.pt-ai-response-actions .pt-ai-btn-action:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #fff !important;
  transform: translateY(-1px) !important;
}

/* Boutons momentanément désactivés (Partager, Report Studio) : visibles, inertes. */
.pt-ai-response-actions .pt-ai-btn-action.is-disabled,
.pt-ai-response-actions .pt-ai-btn-action:disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
}

.pt-ai-response-actions .pt-ai-btn-action.is-disabled:hover,
.pt-ai-response-actions .pt-ai-btn-action:disabled:hover {
  background: transparent !important;
  color: rgba(255, 255, 255, 0.5) !important;
  transform: none !important;
}

.pt-ai-response-actions .pt-ai-btn-action svg {
  width: 12px !important;
  height: 12px !important;
  display: block !important;
}

/* --- IMAGE PREVIEWS --- */
.pt-ai-footer {
  flex-direction: column !important;
  padding: 0 !important;
}

.pt-ai-footer>.flex {
  padding: 16px;
  gap: 12px;
}

#pt-ai-image-previews {
  position: relative !important;
  width: 100% !important;
  max-width: 750px !important;
  margin: 0 auto 10px auto !important;
  max-height: 110px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  display: flex;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  background: rgba(15, 15, 20, 0.75) !important;
  backdrop-filter: blur(20px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  box-shadow:
    0 -10px 25px -5px rgba(0, 0, 0, 0.5),
    0 10px 20px -5px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.05) !important;
  z-index: 100 !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#pt-ai-image-previews:empty,
#pt-ai-image-previews.hidden {
  display: none !important;
  margin-bottom: 0 !important;
}

/* Custom horizontal scrollbar for previews */
#pt-ai-image-previews::-webkit-scrollbar {
  height: 4px !important;
  display: block !important;
}

#pt-ai-image-previews::-webkit-scrollbar-track {
  background: transparent !important;
}

#pt-ai-image-previews::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
}

#pt-ai-image-previews::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--aura-neon-rgb, 255, 106, 0), 0.5) !important;
}

.pt-ai-preview-thumb {
  position: relative !important;
  width: 76px !important;
  height: 76px !important;
  flex-shrink: 0 !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  overflow: hidden !important;
  background: rgba(255, 255, 255, 0.03) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  animation: ptAiMsgIn 0.3s ease-out forwards !important;
}

.pt-ai-preview-thumb:hover {
  transform: translateY(-2px) scale(1.03) !important;
  border-color: rgba(var(--aura-neon-rgb, 255, 106, 0), 0.4) !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4) !important;
}

.pt-ai-preview-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.pt-ai-preview-remove {
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: rgba(15, 15, 20, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.7) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  z-index: 10 !important;
}

.pt-ai-preview-remove:hover {
  background: #f43f5e !important;
  border-color: #f43f5e !important;
  color: #fff !important;
  transform: scale(1.1) rotate(90deg) !important;
}

.pt-ai-image-msg {
  margin-top: 8px;
  border-radius: 8px;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Typing Indicator */
.pt-ai-typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.pt-ai-typing-dots span {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: ptAiTyping 1.4s infinite ease-in-out both;
}

.pt-ai-typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.pt-ai-typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes ptAiTyping {

  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.3;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Upload Button Styling */
#pt-ai-upload-btn {
  opacity: 0.5;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pt-ai-upload-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
  color: var(--pt-primary, #3b82f6);
}

#pt-ai-upload-btn svg {
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.2));
}

/* Document Previews */
.pt-ai-doc-preview {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%) !important;
  padding: 6px !important;
}

.pt-ai-doc-ext {
  font-size: 11px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  color: #f43f5e !important;
  /* Rose-500 red */
  text-shadow: 0 0 10px rgba(244, 63, 94, 0.4) !important;
  margin-bottom: 4px !important;
}

.pt-ai-doc-name {
  font-size: 9px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.7) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
  text-align: center !important;
  padding: 0 4px !important;
}



/* Error Styles */
.pt-ai-message.error .pt-ai-msg-bubble {
  background: rgba(255, 50, 50, 0.1);
  border: 1px solid rgba(255, 50, 50, 0.2);
  color: #ff9999;
}

.pt-ai-message.quota-error .pt-ai-msg-bubble {
  background: rgba(255, 165, 0, 0.1);
  border: 1px solid rgba(255, 165, 0, 0.3);
  color: #ffcc66;
}

.pt-ai-message.quota-error .pt-ai-msg-bubble::before {
  content: "⚠️ ";
}

/* --- PREMIUM USAGE DASHBOARD --- */
#pt-ai-stats-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg,
      rgba(15, 15, 25, 0.4) 0%,
      rgba(10, 10, 20, 0.6) 100%);
}

#pt-ai-stats-panel.active {
  max-height: 600px;
  opacity: 1;
  margin-bottom: 25px;
  transform: scale(1.02);
  backdrop-filter: blur(35px) saturate(180%);
  box-shadow:
    0 30px 60px -12px rgba(0, 0, 0, 0.8),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pt-ai-stat-card {
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.5s var(--ease-premium);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.pt-ai-stat-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Ambient Glows */
.pt-stat-blue:hover {
  box-shadow:
    0 15px 30px -10px rgba(37, 99, 235, 0.25),
    inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.pt-stat-purple:hover {
  box-shadow:
    0 15px 30px -10px rgba(147, 51, 234, 0.25),
    inset 0 0 0 1px rgba(147, 51, 234, 0.2);
}

.pt-stat-orange:hover {
  box-shadow:
    0 15px 30px -10px rgba(234, 88, 12, 0.25),
    inset 0 0 0 1px rgba(234, 88, 12, 0.2);
}

.pt-stat-emerald:hover {
  box-shadow:
    0 15px 30px -10px rgba(5, 150, 105, 0.25),
    inset 0 0 0 1px rgba(5, 150, 105, 0.2);
}

.pt-ai-stat-card svg {
  filter: drop-shadow(0 0 5px currentColor);
}

.pt-ai-stat-card .font-black {
  font-weight: 900;
}

.pt-ai-stat-card .font-extrabold {
  font-weight: 800;
}

#pt-ai-stats-panel .text-white\/90 {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#pt-ai-stats-panel .text-white\/40 {
  color: rgba(255, 255, 255, 0.75) !important;
}

/* Gauge Transitions */
#pt-ai-stats-panel circle {
  transition:
    stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1),
    stroke 0.5s ease;
}

#pt-ai-usage-orb:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 12px rgba(255, 60, 0, 0.5));
}

@keyframes orbPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.08);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.orb-warning {
  animation: orbPulse 1.5s infinite ease-in-out;
  filter: drop-shadow(0 0 10px #ff8400);
}

.orb-critical {
  animation: orbPulse 0.7s infinite ease-in-out;
  filter: drop-shadow(0 0 12px #ff3c00);
}

/* Message Usage Label */
.pt-ai-msg-usage {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  margin: 6px 12px;
  font-family: inherit;
  font-weight: 500;
  display: flex;
  gap: 10px;
  opacity: 0.8;
}


.pt-ai-message.user .pt-ai-msg-usage {
  justify-content: flex-end;
}

/* --- CHIC SYSTEM LOGS --- */
.pt-ai-sys-log {
  margin: 6px 0 6px 28px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 85%;
  animation: pt-ai-fade-in-log 0.4s var(--ease-premium);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-family: 'Inter', sans-serif;
}

.pt-ai-log-pulse {
  width: 6px;
  height: 6px;
  background: #a855f7;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
  flex-shrink: 0;
  animation: pt-ai-log-heartbeat 2s infinite ease-in-out;
}

.pt-ai-log-time {
  font-weight: 600;
  opacity: 0.6;
  font-family: 'JetBrains Mono', monospace;
}

.pt-ai-log-text {
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

@keyframes pt-ai-fade-in-log {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pt-ai-log-heartbeat {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.3);
    opacity: 1;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
  }

  100% {
    transform: scale(1);
    opacity: 0.6;
  }
}

/* --- AMBER TOOL LOGS --- */
.pt-ai-tool-pill {
  margin: 8px 0 2px 28px;
  padding: 7px 16px;
  background: rgba(249, 115, 22, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 14px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 90%;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.1);
  animation: pt-ai-fade-in-log 0.4s var(--ease-premium);
}

.pt-ai-tool-pill i,
.pt-ai-tool-pill svg {
  color: #f97316;
}

.pt-ai-tool-pill .pt-ai-tool-name {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fdba74;
}

.pt-ai-tool-pill .pt-ai-tool-status {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.5;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- EXPERT TECHNICAL LOGS SIDEBAR (HIGH-END TERMINAL) --- */
.pt-ai-log-column {
  display: none;
  flex: 0 0 400px;
  /* Force width and prevent shrinking */
  width: 400px;
  background: #050508 !important;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  transition: all 0.4s var(--ease-premium);
  position: relative;
  overflow-y: auto;
}

.pt-ai-window.pt-ai-has-logs .pt-ai-log-column {
  display: flex;
  flex-direction: column;
}

/* --- TERMINAL STEP LOGS --- */
.pt-ai-step-log {
  position: relative;
  padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace;
  animation: pt-ai-fade-in-log 0.3s ease;
}

/* Vertical line connecting steps */
.pt-ai-step-log::before {
  content: '';
  position: absolute;
  top: 26px;
  /* Exactly under the dot */
  bottom: -10px;
  /* Extends to next step */
  left: 20.5px;
  /* Centered under the 10px dot (16px padding + 5px radius) */
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
  /* Slightly brighter for visibility */
  z-index: 1;
}

.pt-ai-step-log:last-child::before {
  bottom: 0px;
  /* Stops at the end of its content if it's the last one */
}

.pt-ai-step-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.pt-ai-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
  border: 1.5px solid rgba(5, 5, 8, 1);
  margin-top: 3.5px;
}

.pt-ai-step-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  line-height: 1.6;
}

.pt-ai-step-title {
  font-size: 11px;
  font-weight: 500;
  flex: 1 1 0%;
  line-height: 1.6;
  word-break: break-word;
}

.pt-ai-step-title strong {
  font-weight: 800;
}

.pt-ai-step-body {
  margin-top: 4px;
  margin-left: 28px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.pt-ai-step-args {
  color: rgba(167, 139, 250, 0.8);
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pt-ai-step-result {
  color: rgba(255, 255, 255, 0.75);
}

.pt-ai-media-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.pt-ai-media-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.pt-ai-media-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 6px;
}

.pt-ai-media-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pt-ai-session-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pt-ai-session-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.pt-ai-session-item.active {
  background: rgba(var(--aura-neon-rgb), 0.08);
  border-color: var(--aura-neon) !important;
  box-shadow: 0 0 20px rgba(var(--aura-neon-rgb), 0.15), inset 0 0 10px rgba(var(--aura-neon-rgb), 0.05);
}

.pt-ai-session-item.active .pt-ai-session-title-text {
  color: #fff !important;
  text-shadow: 0 0 10px rgba(var(--aura-neon-rgb), 0.3);
}

.pt-ai-session-item.active .pt-ai-session-title-inner svg {
  color: var(--aura-neon) !important;
  opacity: 1 !important;
}

/* --- AURA EXPORT UTILS --- */
.pt-ai-export-direct.loading {
  cursor: wait;
}

.pt-ai-export-direct.loading svg {
  animation: pt-ai-spin 1s linear infinite !important;
}

@keyframes pt-ai-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* --- AURA CHAT COLLAPSE LOGIC --- */
.pt-ai-collapsed-state .pt-ai-message {
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  margin-bottom: 8px !important;
}

.pt-ai-collapsed-state .pt-ai-msg-bubble {
  max-height: 48px !important;
  overflow: hidden !important;
  mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
  pointer-events: none !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.6;
  filter: blur(0.5px);
}

.pt-ai-collapsed-state .pt-ai-message:hover .pt-ai-msg-bubble {
  opacity: 1;
  filter: none;
  max-height: 80px !important;
}

.pt-ai-collapsed-state .pt-ai-thought-section,
.pt-ai-collapsed-state .pt-ai-deliverables-container,
.pt-ai-collapsed-state .pt-ai-plan-container,
.pt-ai-collapsed-state .pt-ai-code-wrapper,
.pt-ai-collapsed-state .pt-ai-mermaid-container,
.pt-ai-collapsed-state .pt-ai-table-wrapper,
.pt-ai-collapsed-state .pt-ai-group-block,
.pt-ai-collapsed-state .pt-ai-callout,
.pt-ai-collapsed-state .pt-ai-recovery-zone {
  display: none !important;
}

#pt-ai-collapse-all.active {
  background: rgba(249, 115, 22, 0.2) !important;
  color: #fb923c !important;
  border-color: rgba(249, 115, 22, 0.4) !important;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.2) !important;
}


.pt-ai-session-title-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.pt-ai-session-title-text {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.pt-ai-session-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  font-family: 'JetBrains Mono', monospace;
}

.pt-ai-meta-item {
  font-size: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pt-ai-meta-item i {
  width: 10px;
  height: 10px;
}

.pt-ai-media-title {
  font-size: 10px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-ai-media-meta {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

/* --- MARKDOWN TABLES --- */


.pt-ai-table th {
  color: var(--pt-accent, #f97316);
}


.pt-ai-table tr:last-child td {
  border-bottom: none;
}

.pt-ai-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* --- MEDIA MODAL --- */
.pt-ai-media-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.pt-ai-media-modal.active {
  display: flex;
  animation: ptAiFadeIn 0.3s ease;
}

.pt-ai-modal-content {
  max-width: 1200px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pt-ai-modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pt-ai-modal-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.pt-ai-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
  border-radius: 12px;
}

.pt-ai-result-glass {
  margin: 0 12% 8px 28px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 16px 16px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.6;
  word-break: break-all;
  overflow-wrap: anywhere;
  animation: pt-ai-fade-in-log 0.5s var(--ease-premium);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.pt-ai-result-glass .pt-ai-tool-args {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pt-ai-tool-status.completed {
  color: #4ade80 !important;
  opacity: 0.9 !important;
}

/* --- ACTIONS --- */
.pt-ai-action-btn {
  position: absolute;
  bottom: -12px;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s var(--ease-premium);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  z-index: 10;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pt-ai-edit-btn {
  right: 32px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

.pt-ai-retry-btn {
  left: 40px;
  background: rgba(249, 115, 22, 0.15);
  color: rgba(251, 146, 60, 0.8);
  border: 1px solid rgba(249, 115, 22, 0.2) !important;
}

.pt-ai-message.group:hover .pt-ai-action-btn {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.pt-ai-edit-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.pt-ai-retry-btn:hover {
  background: rgba(249, 115, 22, 0.3);
  color: #fdba74;
  transform: translateY(-1px);
}

/* --- PREMIUM MESSAGE FORMATTING (Aura Design System) --- */
.pt-ai-msg-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 11.5px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.95);
}

/* --- TITRES (HEADING SYSTEM) --- */
.pt-ai-msg-text h1,
.pt-ai-msg-text h2,
.pt-ai-msg-text h3,
.pt-ai-msg-text h4,
.pt-ai-msg-text h5,
.pt-ai-msg-text h6 {
  color: #fff;
  font-weight: 900;
  margin-top: 32px;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  font-family: 'Outfit', sans-serif;
  line-height: 1.3;
}

.pt-ai-msg-text h1 {
  font-size: 24px;
  background: linear-gradient(to right, #ffffff, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-bottom: 4px;
}

.pt-ai-msg-text h2 {
  font-size: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.pt-ai-msg-text h3 {
  font-size: 16px;
  color: #fb923c;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pt-ai-msg-text h4 {
  font-size: 14px;
  opacity: 0.9;
}

.pt-ai-msg-text h5 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.pt-ai-msg-text h6 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.5;
}

/* --- SEPARATEURS (HR) --- */
.pt-ai-hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(249, 115, 22, 0.5), transparent);
  margin: 28px 0;
  position: relative;
}

.pt-ai-hr::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: #f97316;
  filter: blur(5px);
  opacity: 0.4;
}

/* Response Separator (Special for end of reasoning) */
.pt-ai-response-separator {
  height: 1px;
  background: linear-gradient(to right, rgba(249, 115, 22, 0.4) 0%, transparent 70%);
  margin: 24px 0;
  position: relative;
  width: 60%;
}

.pt-ai-response-separator::before {
  content: '';
  position: absolute;
  left: 0;
  top: -3px;
  width: 8px;
  height: 8px;
  background: #f97316;
  border-radius: 50%;
  filter: blur(2px);
  box-shadow: 0 0 10px #f97316;
}

/* --- LISTES (CUSTOM LISTS) --- */
.pt-ai-list {
  list-style: none !important;
  padding-left: 4px !important;
  margin: 16px 0 !important;
}

.pt-ai-list li {
  padding-left: 24px !important;
}

.pt-ai-list li::before {
  background: var(--aura-neon);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--aura-glow);
}

/* Hide diamond bullet if the item contains a preview card (Expert Cleanup) */
.pt-ai-list li:has(.pt-ai-file-preview-card)::before {
  display: none;
}

.pt-ai-list li:has(.pt-ai-file-preview-card) {
  padding-left: 0 !important;
}

/* Numbered Lists */
.pt-ai-list-ol {
  counter-reset: aura-counter;
}

.pt-ai-list-ol li {
  counter-increment: aura-counter;
}

.pt-ai-list-ol li::before {
  content: counter(aura-counter);
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 5px;
  color: #fb923c;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: none;
  box-shadow: none;
}

/* --- BLOCS & CITATIONS (LIQUID GLASS) --- */
.pt-ai-blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-left: 3px solid #f97316;
  border-radius: 4px 12px 12px 4px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.pt-ai-blockquote::after {
  content: '“';
  position: absolute;
  right: 10px;
  top: -10px;
  font-size: 60px;
  color: rgba(255, 255, 255, 0.03);
  font-family: serif;
}

/* --- BADGES & ENTITIES --- */
.pt-ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 6px;
  color: #fb923c;
  font-size: 10px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  margin: 2px;

  /* PREVENT OVERFLOW (Aura Fix) */
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
  max-width: 100%;
}

/* --- CALLOUTS (NOTE / WARNING) --- */
.pt-ai-callout {
  margin: 16px 0;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.02);
}

.pt-ai-callout-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.pt-ai-callout.note {
  border-left: 3px solid #3b82f6;
  background: rgba(59, 130, 246, 0.03);
}

.pt-ai-callout.note .pt-ai-callout-icon {
  color: #3b82f6;
}

.pt-ai-callout.warning {
  border-left: 3px solid #eab308;
  background: rgba(234, 179, 8, 0.03);
}

.pt-ai-callout.warning .pt-ai-callout-icon {
  color: #eab308;
}

.pt-ai-callout.tip {
  border-left: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.03);
}

.pt-ai-callout.tip .pt-ai-callout-icon {
  color: #10b981;
}

.pt-ai-callout-content {
  flex: 1;
  font-size: 11px;
}

.pt-ai-callout-title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: block;
}

/* --- TASK LISTS (CHECKLISTS) --- */
.pt-ai-task-list {
  margin: 16px 0;
}

.pt-ai-task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  transition: all 0.3s;
}

.pt-ai-task-check {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  background: rgba(0, 0, 0, 0.2);
}

.pt-ai-task-item.checked .pt-ai-task-check {
  background: #f97316;
  border-color: #f97316;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

.pt-ai-task-item.checked .pt-ai-task-text {
  opacity: 0.5;
  text-decoration: line-through;
}

/* --- REGROUPEMENT (GROUP BLOCKS) --- */
.pt-ai-group-block {
  margin: 8px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 1);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;

  /* PREVENT OVERFLOW (Aura Fix) */
  max-width: 100%;
  word-break: break-word;
  overflow: hidden;
}

.pt-ai-group-block>*:first-child {
  margin-top: 0;
}

.pt-ai-group-block>*:last-child {
  margin-bottom: 0;
}

/* REASONING / THINKING BLOCK (ACCORDION) */
.pt-ai-thought-section {
  margin: 4px 0 12px 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  overflow: hidden;
  transition: all 0.3s ease;
}

.pt-ai-thought-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--pt-primary, #6366f1) !important;
  /* Primary Brand Color for Reflection */
  font-size: 9.5px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: rgba(99, 102, 241, 0.05) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.2;
  /* Better vertical alignment */
}

.pt-ai-thought-header:hover {
  background: rgba(99, 102, 241, 0.1) !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1) !important;
}

.pt-ai-thought-header-flat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--pt-primary, #6366f1) !important;
  font-size: 9.5px;
  user-select: none;
  background: rgba(99, 102, 241, 0.05) !important;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2) !important;
  border-radius: 10px 10px 0 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.2;
}

.pt-ai-thought-section.is-completed .pt-ai-thought-header-flat {
  border-bottom-color: rgba(34, 197, 94, 0.2) !important;
  color: #22c55e !important;
  background: rgba(34, 197, 94, 0.05) !important;
}

.pt-ai-thought-section.is-completed .pt-ai-thought-header-flat svg {
  color: #22c55e !important;
}

.pt-ai-thought-section.is-streaming .pt-ai-thought-header-flat::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pt-ai-thought-pulse 1.2s ease-in-out infinite;
}

@keyframes pt-ai-thought-pulse {

  0%,
  100% {
    opacity: 0.25;
  }

  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pt-ai-thought-section.is-streaming .pt-ai-thought-header-flat::after {
    animation: none;
  }
}

.pt-ai-thought-section.is-error .pt-ai-thought-header-flat,
.pt-ai-thought-section.is-interrupted .pt-ai-thought-header-flat {
  border-bottom-color: rgba(244, 63, 94, 0.2) !important;
  color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.05) !important;
}

.pt-ai-thought-section.is-error .pt-ai-thought-header-flat svg,
.pt-ai-thought-section.is-interrupted .pt-ai-thought-header-flat svg {
  color: #f43f5e !important;
}

.pt-ai-thought-status {
  margin-left: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pt-ai-thought-status.running {
  background: rgba(99, 102, 241, 0.2) !important;
  color: var(--pt-primary, #6366f1) !important;
  animation: pt-ai-pulse-status 1.5s infinite;
}

.pt-ai-thought-status.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.1);
}

.pt-ai-thought-status.interrupted {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
}

@keyframes pt-ai-pulse-status {
  0% {
    opacity: 0.6;
    transform: scale(0.95);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0.6;
    transform: scale(0.95);
  }
}

.pt-ai-thought-header::-webkit-details-marker {
  display: none;
}

.pt-ai-thought-header svg {
  color: var(--pt-primary, #6366f1) !important;
}

.pt-ai-thought-header::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--pt-primary, #6366f1) !important;
  border-bottom: 1.5px solid var(--pt-primary, #6366f1) !important;
  transform: rotate(45deg);
  margin-left: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  top: -0.5px;
  /* Fine-tuned alignment */
}

.pt-ai-thought-section[open] .pt-ai-thought-header::after {
  transform: rotate(-135deg);
}

.pt-ai-thought-section.is-completed .pt-ai-thought-header {
  border-color: rgba(34, 197, 94, 0.4) !important;
  color: #22c55e !important;
  background: rgba(34, 197, 94, 0.05) !important;
}

.pt-ai-thought-section.is-completed .pt-ai-thought-header svg {
  color: #22c55e !important;
}

.pt-ai-thought-section.is-completed .pt-ai-thought-header::after {
  border-color: #22c55e !important;
}

.pt-ai-thought-section.is-completed .pt-ai-thought-header:hover {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: rgba(34, 197, 94, 0.5) !important;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.1) !important;
}

.pt-ai-thought-section.is-completed .pt-ai-thought-header svg,
.pt-ai-thought-section.is-completed .pt-ai-thought-header::after {
  color: #22c55e !important;
  border-color: #22c55e !important;
}

/* 🟥 Error / Interrupted Accordion styling (Red if Error) */
.pt-ai-thought-section.is-error .pt-ai-thought-header,
.pt-ai-thought-section.is-interrupted .pt-ai-thought-header {
  border-color: rgba(244, 63, 94, 0.4) !important;
  color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.05) !important;
}

.pt-ai-thought-section.is-error .pt-ai-thought-header svg,
.pt-ai-thought-section.is-interrupted .pt-ai-thought-header svg {
  color: #f43f5e !important;
}

.pt-ai-thought-section.is-error .pt-ai-thought-header::after,
.pt-ai-thought-section.is-interrupted .pt-ai-thought-header::after {
  border-color: #f43f5e !important;
}

.pt-ai-thought-section.is-error .pt-ai-thought-header:hover,
.pt-ai-thought-section.is-interrupted .pt-ai-thought-header:hover {
  background: rgba(244, 63, 94, 0.1) !important;
  border-color: rgba(244, 63, 94, 0.5) !important;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.1) !important;
}

.pt-ai-thought-section.is-error .pt-ai-thought-header svg,
.pt-ai-thought-section.is-error .pt-ai-thought-header::after,
.pt-ai-thought-section.is-interrupted .pt-ai-thought-header svg,
.pt-ai-thought-section.is-interrupted .pt-ai-thought-header::after {
  color: #f43f5e !important;
  border-color: #f43f5e !important;
}

.pt-ai-thought-section.is-error[open] .pt-ai-thought-header,
.pt-ai-thought-section.is-interrupted[open] .pt-ai-thought-header {
  border-bottom-color: rgba(244, 63, 94, 0.2) !important;
  background: rgba(244, 63, 94, 0.08) !important;
}

.pt-ai-thought-section[open] .pt-ai-thought-header {
  border-bottom: 1px solid rgba(99, 102, 241, 0.2) !important;
  border-radius: 10px 10px 0 0;
  background: rgba(99, 102, 241, 0.08) !important;
  margin-bottom: 0;
}

.pt-ai-thought-section.is-completed[open] .pt-ai-thought-header {
  border-bottom-color: rgba(34, 197, 94, 0.2) !important;
  background: rgba(34, 197, 94, 0.08) !important;
}

/* Content inside details */
.pt-ai-thought-content {
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10.5px;
}

/* --- PREMIUM FILE PREVIEW SYSTEM (Image, Video, PDF) --- */
.pt-ai-file-preview-card {
  margin: 8px 0;
  width: 260px;
  max-width: 100%;
  /* Expansion totale */
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* Prepare for hover border */
  border-radius: 14px;
  overflow: hidden;
}

.pt-ai-file-preview-card:hover {
  border-color: var(--aura-neon);
  /* Primary Accent */
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(var(--aura-neon-rgb), 0.2);
  transform: translateY(-2px);
}

/* Media Container (Forced 16:9 Ratio) */
.pt-ai-preview-media {
  width: 100%;
  height: 100%;
  padding-bottom: 56.25%;
  /* 16:9 Ratio */
  background: #ffffff;
  overflow: hidden;
  position: absolute;
  /* Border moved to the card for full coverage */
}

.pt-ai-preview-media img,
.pt-ai-preview-media video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  object-fit: contain;
  /* Don't crop, keep original aspect */
  object-position: center center;
  display: block;
}

/* Specific PDF State */
.pt-ai-preview-media.pt-pdf-preview {
  background: linear-gradient(135deg, #15151f 0%, #0a0a0f 100%);
  padding-bottom: 56.25%;
  height: 0;
}

.pt-ai-pdf-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pt-ai-pdf-icon-wrapper {
  width: 100%;
  height: 60px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f97316;
}

/* Hover Overlay Hooks */
.pt-ai-file-preview-card .pt-ai-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: all 0.3s var(--ease-premium);
  pointer-events: none;
  z-index: 5;
}

.pt-ai-file-preview-card:hover .pt-ai-preview-overlay {
  pointer-events: auto;
}

/* Play Icon for Videos (Center) */
.pt-ai-video-play-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 54px;
  height: 54px;
  background: rgba(249, 115, 22, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 25px rgba(249, 115, 22, 0.4);
  transition: all 0.3s var(--ease-premium);
  z-index: 10;
}

.pt-ai-file-preview-card:hover .pt-ai-video-play-hint {
  transform: translate(-50%, -50%) scale(1);
  background: #f97316;
}

/* Action Buttons (Top-Right) */
.pt-ai-preview-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 20;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s var(--ease-premium);
  pointer-events: auto;
}

.pt-ai-file-preview-card:hover .pt-ai-preview-actions {
  opacity: 1;
  transform: translateY(0);
}

.pt-ai-preview-action-btn {
  width: 36px;
  height: 36px;
  background: #000;
  border: 1px solid rgba(249, 115, 22, 0.4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.pt-ai-preview-action-btn:hover {
  background: #f97316;
  border-color: #f97316;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.3);
}

.pt-ai-preview-action-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5px;
}


/* Enhanced Link Buttons (Command Style) */
.pt-ai-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: #0a0a0f;
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 14px;
  color: #fff !important;
  font-weight: 800;
  font-size: 11.5px;
  text-decoration: none !important;
  margin: 8px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.pt-ai-link-btn i,
.pt-ai-link-btn svg {
  color: #f97316;
  stroke-width: 2.5px;
}

.pt-ai-link-btn:hover {
  background: #111118;
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.15);
  transform: translateY(-2px);
}

.pt-ai-link-btn:active {
  transform: scale(0.97);
}

/* Lightbox / Viewer Overlay */
#pt-ai-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.3s var(--ease-premium);
}

#pt-ai-viewer-overlay.active {
  display: flex;
  opacity: 1;
}

.pt-ai-viewer-container {
  max-width: 90%;
  max-height: 90%;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s var(--ease-premium);
}

#pt-ai-viewer-overlay.active .pt-ai-viewer-container {
  transform: scale(1);
}

.pt-ai-viewer-content {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  background: #000;
}

.pt-ai-viewer-content img {
  max-width: 100%;
  max-height: 85vh;
  display: block;
}

.pt-ai-viewer-content iframe {
  width: 80vw;
  height: 85vh;
  border: none;
  background: #fff;
}

.pt-ai-viewer-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.pt-ai-viewer-close:hover {
  background: #f43f5e;
  transform: rotate(90deg);
}

/* Tables (Liquid Glass) */
.pt-ai-table-wrapper {
  overflow: hidden;
}


.pt-ai-table th {
  text-align: left;
}


.pt-ai-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
}

/* Code Blocks */
.pt-ai-code-wrapper {
  position: relative;
  margin: 16px 0;
  border-radius: 12px;
  background: #050508;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.pt-ai-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pt-ai-code-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.pt-ai-copy-btn {
  cursor: pointer;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

.pt-ai-copy-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.pt-ai-code-block {
  padding: 16px;
  margin: 0 !important;
  background: transparent !important;
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 11px !important;
  line-height: 1.6;
  overflow-x: auto;
}

/* Blockquotes */
/* Web Preview Container */
.pt-ai-web-preview-container {
  position: relative;
  margin: 16px 0;
  border-radius: 12px;
  background: #050508;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pt-ai-web-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pt-ai-web-tabs {
  display: flex;
}

.pt-ai-web-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
}

.pt-ai-web-tab:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.02);
}

.pt-ai-web-tab.active {
  color: #f97316;
  background: rgba(249, 115, 22, 0.05);
  box-shadow: inset 0 -2px 0 #f97316;
}

.pt-ai-web-actions {
  display: flex;
  padding-right: 8px;
  gap: 4px;
}

.pt-ai-web-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.pt-ai-web-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.pt-ai-web-body {
  position: relative;
  width: 100%;
}

.pt-ai-web-pane {
  width: 100%;
}

.pt-ai-web-preview {
  background: #ffffff;
  height: 400px;
  min-height: 200px;
  max-height: 80vh;
}

.pt-ai-web-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.pt-ai-blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  background: rgba(249, 115, 22, 0.05);
  border-left: 3px solid #f97316;
  border-radius: 4px 12px 12px 4px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
}

/* Utilities */
.pt-ai-hr {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  border: none;
  margin: 24px 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   AURA MASCOT SYSTEM (Interactive Robot Entity - ULTIMATE)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.pt-ai-mascot-wrapper.robot-mode {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pt-ai-mascot-wrapper.robot-mode:hover {
  transform: scale(1.1) rotate(-3deg);
}

.robot-head {
  width: 85px;
  height: 75px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: robot-float 4s ease-in-out infinite;
  transform-origin: bottom center;
}

/* Robot Shell Styling (Ultra Glossy) */

.robot-top-bar {
  fill: #00deff;
  opacity: 0.4;
  animation: robot-bar-pulse 2s ease-in-out infinite;
}

.robot-face-screen {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 0.5;
}

/* Facial Elements */
.robot-brow {
  fill: none;
  stroke: #00deff;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.4;
  transition: all 0.4s ease;
}

.eye-ring-outer {
  stroke: var(--aura-neon);
  opacity: 0.6;
}

.eye-ring-inner {
  stroke: #00deff;
  stroke-width: 2;
  opacity: 0.8;
}

.eye-pupil-main {
  fill: #00deff;
  opacity: 0.9;
}

.eye-gloss {
  pointer-events: none;
}

/* Blush & Hearts */
.blush-circle {
  transition: all 0.5s ease;
}

.aura-heart {
  fill: #ff2d55;
  opacity: 0;
  transform-origin: center;
  transition: all 0.5s ease;
}

/* Surprised */
.robot-mode.mood-surprised .mouth-surprised {
  opacity: 1;
  transform: scale(1.2);
}

.robot-mode.mood-surprised .mouth-neutral {
  opacity: 0;
}

.robot-mode.mood-surprised .robot-brow {
  transform: translateY(-6px);
  opacity: 1;
}

/* KEYFRAMES - ULTIMATE */

@keyframes aura-blush-pulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@keyframes aura-heart-float {
  0% {
    transform: translateY(0) scale(0) rotate(0deg);
    opacity: 0;
  }

  20% {
    opacity: 1;
    transform: translateY(-5px) scale(1) rotate(-10deg);
  }

  100% {
    transform: translateY(-30px) scale(0.5) rotate(20deg);
    opacity: 0;
  }
}

@keyframes robot-float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-5px) rotate(1deg);
  }

  75% {
    transform: translateY(-3px) rotate(-1deg);
  }
}

@keyframes robot-talk {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(2px);
  }
}

@keyframes robot-blink-global {

  0%,
  95%,
  100% {
    transform: scaleY(1);
  }

  97.5% {
    transform: scaleY(0.05);
  }
}

.aura-eyes {
  transform-origin: 50% 52%;
  animation: robot-blink-global 4s linear infinite;
}

/* Tooltip Polish */
.pt-ai-mascot-tooltip {
  border: 1px solid var(--aura-glow);
  white-space: nowrap;
}


/* Sidekick Slide Integration: Legacy hiding rule removed to enable NextGen push mechanic */


/* NextGen Tabbed Expert Console */
.pt-ai-tabs-nav {
  gap: 1.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0;
}

.pt-ai-tab-btn {
  position: relative;
  padding: 0.75rem 0.25rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-premium);
}

.pt-ai-tab-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.pt-ai-tab-btn.active {
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.pt-ai-tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #f97316, #f59e0b);
  transition: width 0.3s var(--ease-premium);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

.pt-ai-tab-btn.active::after {
  width: 100%;
}

.pt-ai-tab-content {
  animation: pt-ai-fadeIn 0.4s var(--ease-premium);
  overflow-y: auto;
  overflow-x: hidden;
}

.pt-ai-tab-content::-webkit-scrollbar {
  width: 4px;
}

.pt-ai-tab-content::-webkit-scrollbar-track {
  background: transparent;
}

.pt-ai-tab-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

#pt-ai-tab-terminal {
  overflow: hidden !important;
}

@keyframes pt-ai-fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#pt-ai-tabs-container .hidden {
  display: none !important;
}

.pt-ai-tab-content span.roadmap {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(245, 158, 11, 0.05));
  border-color: rgba(249, 115, 22, 0.1);
}


/* Files Tab Explorer */
.pt-ai-files-grid {
  grid-template-columns: repeat(2, 1fr);
  padding: 1rem;
}

.pt-ai-file-tab-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px border rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s var(--ease-premium);
  display: flex;
  flex-direction: column;
}

.pt-ai-file-tab-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(249, 115, 22, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.5);
}

.pt-ai-file-tab-card-preview {
  position: relative;
  aspect-ratio: 4/3;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pt-ai-file-tab-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  opacity: 0.8;
  transition: transform 0.3s var(--ease-premium);
}

.pt-ai-file-tab-card:hover .pt-ai-file-tab-card-preview img {
  transform: scale(1.05);
  opacity: 1;
}

.pt-ai-file-tab-icon-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05));
}

.pt-ai-file-tab-source-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.pt-ai-file-tab-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s var(--ease-premium);
  backdrop-filter: blur(4px);
}

.pt-ai-file-tab-card:hover .pt-ai-file-tab-overlay {
  opacity: 1;
}

.pt-ai-file-tab-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pt-ai-file-tab-action-btn:hover {
  background: #f97316;
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.pt-ai-file-tab-action-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.pt-ai-file-tab-action-btn .pt-ai-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: pt-ai-spin 0.8s linear infinite;
}

@keyframes pt-ai-spin {
  to {
    transform: rotate(360deg);
  }
}

.pt-ai-file-tab-card-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pt-ai-file-tab-name {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-ai-file-tab-meta {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-mono);
}

/* --- PLANNING TAB & ACTION BLOCKS --- */

.pt-ai-tab-content#pt-ai-tab-plan {
  padding: 0;
  background: #000;
  overflow-y: auto;
}

/* Accordion Animation Logic */
.pt-ai-accordion-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.pt-ai-accordion-wrapper.open {
  grid-template-rows: 1fr;
}

.pt-ai-accordion-inner {
  overflow: hidden;
  min-height: 0;
}

/* WBS Tree Line - Higher Precision & Reset */
.pt-ai-tree-line {
  position: relative;
  padding-left: 14px !important;
  margin-left: 4px !important;
  margin-bottom: 0 !important;
}

/* Force Reset for any host theme h4/span overrides */
.pt-ai-tree-line h4,
.pt-ai-accordion-inner h4 {
  font-size: 9px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.25 !important;
  display: flex !important;
  align-items: center !important;
  color: inherit;
}

.pt-ai-tree-line span,
.pt-ai-accordion-inner span {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}

.pt-ai-tree-line::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: -8px;
  left: 0px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
  z-index: 1;
  transition: background 0.5s ease;
}

.pt-ai-tree-line:has(.text-indigo-400)::before {
  background: linear-gradient(to bottom, rgba(99, 102, 241, 0.6) 0%, rgba(99, 102, 241, 0.2) 50%, transparent 100%) !important;
}

.pt-ai-tree-line:last-child::before {
  display: none;
}

/* Fix phase hover in chat: restore individual phase focus */
.pt-ai-msg-plan-block.is-chat-context.pt-ai-no-hover:hover {
  background: inherit !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Phase Header Uniformization - High Specificity */
.pt-ai-phase-title {
  font-size: 9px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 700 !important;
  text-transform: none !important;
  letter-spacing: -0.01em !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: normal !important;
  font-family: 'Poppins', sans-serif !important;
}

.pt-ai-msg-text .pt-ai-phase-title {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Pulse Animation */
.pt-ai-pulse-ring {
  animation: pt-ai-pulse 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pt-ai-pulse {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.5);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0);
  }

  100% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

/* Plan Card Global */
.pt-ai-plan-card {
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  margin: 12px;
}

.pt-ai-plan-card.completed {
  border-color: rgba(16, 185, 129, 0.2);
  background: #f0fdf4;
}

.pt-ai-plan-card.canceled {
  opacity: 0.6;
  background: #f8fafc;
}

/* Action Plan Block - Refined */
.pt-ai-msg-plan-block {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1px;
  /* Subtle inset feel */
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.pt-ai-msg-plan-block.is-chat-context {
  background: rgba(20, 20, 25, 0.4);
  border-color: rgba(255, 255, 255, 0.05);
  width: 100% !important;
}



.pt-ai-msg-plan-block.is-chat-context .pt-ai-accordion-inner .p-0>div {
  border-radius: 0;
  border-left: none;
  border-right: none;
}

.pt-ai-msg-plan-block.is-chat-context>.pt-ai-accordion-wrapper {
  max-height: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: 100%;
}


.pt-ai-plan-icon {
  background: linear-gradient(135deg, #f97316, #ea580c);
  display: flex;
  color: #ffffff;
}


.pt-ai-plan-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
  padding-left: 4px;
}

.pt-ai-plan-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

.pt-ai-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.pt-ai-status-dot.completed {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.pt-ai-status-dot.running {
  background: #6366f1;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

/* --- AURA CONTINUITY MODAL (GLASSMORPHISM) --- */
.pt-ai-continuity-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3500000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pt-ai-continuity-modal.active {
  opacity: 1;
  visibility: visible;
}

.pt-ai-continuity-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
}

.pt-ai-continuity-content {
  position: relative;
  width: 90%;
  max-width: 440px;
  background: rgba(25, 25, 35, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: translateY(20px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  overflow: hidden;
}

.pt-ai-continuity-modal.active .pt-ai-continuity-content {
  transform: translateY(0) scale(1);
}

.pt-ai-continuity-icon-zone {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(245, 157, 21, 0.15) 0%, transparent 70%);
}

.pt-ai-continuity-aura-icon {
  width: 48px;
  height: 48px;
  color: var(--portal-orange);
  filter: drop-shadow(0 0 15px rgba(245, 157, 21, 0.4));
  animation: aura-float 3s ease-in-out infinite;
}

.pt-ai-continuity-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(245, 157, 21, 0.3);
  animation: aura-expand-pulse 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes aura-expand-pulse {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }

  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@keyframes aura-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.pt-ai-continuity-content h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.pt-ai-continuity-content p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin-bottom: 30px;
}

.pt-ai-continuity-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pt-ai-continuity-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 16px;
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s var(--ease-premium);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pt-ai-continuity-btn.btn-background {
  background: var(--portal-orange);
  color: #fff;
  border: none;
  box-shadow: 0 10px 25px -5px rgba(245, 157, 21, 0.4);
}

.pt-ai-continuity-btn.btn-background:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(245, 157, 21, 0.5);
  filter: brightness(1.1);
}

.pt-ai-continuity-btn.btn-cancel {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.pt-ai-continuity-btn.btn-cancel:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* Background Indicator on Sidebar */
.pt-ai-session-item.background-active {
  position: relative;
}

.pt-ai-session-item.background-active::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--portal-orange);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--portal-orange);
  animation: pt-pulse-orange 1.5s infinite;
}

@keyframes pt-pulse-orange {
  0% {
    transform: translateY(-50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(-50%) scale(2.5);
    opacity: 0;
  }
}

/* Background lock overlay for other sessions */
.pt-ai-background-lock {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(15, 15, 25, 0.95), transparent);
  z-index: 10;
  text-align: center;
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pt-ai-background-lock i {
  color: var(--portal-orange);
  animation: aura-float 2s ease-in-out infinite;
}

.pt-ai-background-lock span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
}

/* ── Terminal Request Grouping (Accordions) ── */
.pt-ai-request-group {
  flex-shrink: 0;
  margin-bottom: 24px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(30, 30, 35, 0.3);
  transition: all 0.3s var(--ease-premium);
}

.pt-ai-request-group:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(40, 40, 45, 0.4);
}

.pt-ai-request-header {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s var(--ease-premium);
}

.pt-ai-request-header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pt-ai-request-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.pt-ai-request-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt-ai-request-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.05em;
}

.pt-ai-request-time {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: -0.01em;
}

.pt-ai-request-status-badge {
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

/* Status Colors */
.status-running {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
}

.status-success {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-error {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
}

.status-interrupted {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.status-refused {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
}

.pt-ai-request-header-bottom {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pt-ai-request-snippet {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 24px);
}

.pt-ai-request-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  transition: all 0.3s ease;
}

.pt-ai-request-dot.success {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.pt-ai-request-dot.error {
  background: #f43f5e;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.pt-ai-request-dot.interrupted {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.pt-ai-request-dot.refused {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.pt-ai-request-group.collapsed .pt-ai-request-header {
  border-bottom: none;
}

.pt-ai-request-group.collapsed .pt-ai-request-body {
  display: none;
}

.pt-ai-request-body {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pt-ai-request-toggle {
  transition: transform 0.3s var(--ease-premium);
  opacity: 0.3;
}

.pt-ai-request-group.collapsed .pt-ai-request-toggle {
  transform: rotate(-90deg);
}

/* --- AI CHAT FILE UPLOAD PROGRESS --- */
.pt-ai-preview-thumb {
  position: relative;
  overflow: hidden;
}

.pt-ai-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 5;
  transition: all 0.4s ease;
}

.pt-ai-preview-thumb.upload-complete .pt-ai-upload-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pt-ai-upload-progress-container {
  width: 70%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}

.pt-ai-upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f4711f, #ff9d5c);
  width: 0%;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(244, 113, 31, 0.5);
}

.pt-ai-upload-status {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pt-ai-preview-thumb.upload-complete .pt-ai-upload-status {
  transform: scale(1.2);
}

/* AI Code Loading Animations */
.pt-ai-build-wrapper {
  position: relative;
  margin: 16px 0;
  border-radius: 14px;
  background: #08080c;
  border: 1px solid rgba(249, 115, 22, 0.25);
  overflow: hidden;
  box-shadow: 0 0 50px rgba(249, 115, 22, 0.08) inset, 0 10px 30px rgba(0, 0, 0, 0.5);
  aspect-ratio: 16 / 9;
  max-height: 400px;
}

.pt-ai-build-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(249, 115, 22, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(249, 115, 22, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center center;
  opacity: 0.8;
  animation: pt-ai-grid-pan 15s linear infinite;
  pointer-events: none;
}

@keyframes pt-ai-grid-pan {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 24px;
  }
}

.pt-ai-build-scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #f97316;
  box-shadow: 0 0 25px 4px rgba(249, 115, 22, 0.9);
  animation: pt-ai-scan 3s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
  pointer-events: none;
  z-index: 2;
}

@keyframes pt-ai-scan {
  0% {
    top: 0%;
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  85% {
    opacity: 1;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

.pt-ai-build-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.15), transparent);
  border-bottom: 1px solid rgba(249, 115, 22, 0.15);
  position: relative;
  z-index: 3;
}

.pt-ai-build-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  color: #f97316;
  letter-spacing: 0.15em;
  text-shadow: 0 0 15px rgba(249, 115, 22, 0.5);
}

.pt-ai-build-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.08em;
  animation: pt-ai-pulse-text 2s ease-in-out infinite;
  margin-top: 15px;
}

@keyframes pt-ai-pulse-text {

  0%,
  100% {
    opacity: 0.7;
  }

  50% {
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  }
}

.pt-ai-build-ring {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.1);
  border-top-color: #f97316;
  border-right-color: #f97316;
  animation: pt-ai-spin-glow 1s linear infinite;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

@keyframes pt-ai-spin-glow {
  0% {
    transform: rotate(0deg);
    border-top-color: #f97316;
  }

  50% {
    border-top-color: #00deff;
    border-right-color: #00deff;
    box-shadow: 0 0 15px rgba(0, 222, 255, 0.6);
  }

  100% {
    transform: rotate(360deg);
    border-top-color: #f97316;
  }
}

.pt-ai-build-body {
  position: relative;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100% - 40px);
  z-index: 3;
}

.pt-ai-build-icon {
  color: #f97316;
  opacity: 0.8;
  animation: pt-ai-float-icon 3s ease-in-out infinite;
  filter: drop-shadow(0 0 15px rgba(249, 115, 22, 0.6));
}

@keyframes pt-ai-float-icon {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-10px) scale(1.05);
    filter: drop-shadow(0 0 25px rgba(249, 115, 22, 0.9));
  }
}

.pt-ai-build-lines-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(249, 115, 22, 0.2) inset;
  backdrop-filter: blur(5px);
}

.pt-ai-build-lines-badge span {
  color: #f97316;
  font-weight: 800;
  font-size: 11px;
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

/* Plan d'Action Split UI */
.pt-ai-mini-plan-card {
  transition: all 0.3s var(--ease-premium);
  animation: pt-ai-slideIn 0.4s var(--ease-premium);
}

.pt-ai-mini-plan-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pt-ai-mini-plan-card li {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  transition: color 0.3s;
}

.pt-ai-mini-plan-card li span {
  border: none;
  box-shadow: none;
}

.pt-ai-mini-plan-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.05);
}

#pt-ai-tab-plan {
  background: #080808;
}

#plan-zone {
  padding-bottom: 50px;
}

/* AI Resource Usage Accordion Styling */
.pt-ai-usage-accordion {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pt-ai-usage-accordion-content {
  animation: pt-accordion-slide-down 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: top center;
}

@keyframes pt-accordion-slide-down {
  from {
    opacity: 0;
    transform: scaleY(0.95);
  }

  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

.pt-ai-usage-accordion-content.hidden {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────
   Lignes d'action (garde-fou HITL et actions exécutées)
   Un seul composant, quatre états. Remplace la carte inline et le bloc
   « actions réellement effectuées », qui répétaient la même information
   dans deux boîtes imbriquées.
   ───────────────────────────────────────────────────────────────────── */

.pt-ai-hitl {
  --hitl: 234 179 8;
  /* ambre — en attente */
  --hitl-soft: 253 235 196;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: start;
  gap: 3px 10px;
  margin: 10px 0 0;
  padding: 9px 11px;
  border: 1px solid rgb(var(--hitl) / 0.28);
  border-radius: 8px;
  background: rgb(var(--hitl) / 0.06);
}

.pt-ai-hitl[data-state="done"] {
  --hitl: 34 197 94;
  --hitl-soft: 198 246 220;
}

.pt-ai-hitl[data-state="rejected"],
.pt-ai-hitl[data-state="failed"] {
  --hitl: 239 68 68;
  --hitl-soft: 254 214 214;
}

.pt-ai-hitl-icon {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  height: 17px;
  color: rgb(var(--hitl));
}

.pt-ai-hitl-icon svg {
  width: 15px;
  height: 15px;
}

.pt-ai-hitl-label {
  grid-area: 1 / 2;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 17px;
  color: rgba(255, 255, 255, 0.92);
}

.pt-ai-hitl-side {
  grid-area: 1 / 3;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pt-ai-hitl-detail {
  grid-area: 2 / 2;
  min-width: 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: rgb(var(--hitl-soft) / 0.62);
  /* teinté sur l'état, jamais gris */
  overflow-wrap: anywhere;
}

.pt-ai-hitl-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.pt-ai-hitl-link svg {
  width: 15px;
  height: 15px;
}

.pt-ai-hitl-link {
  padding: 0 10px;
  border-color: rgb(var(--hitl) / 0.35);
  color: rgb(var(--hitl));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pt-ai-hitl-link:hover {
  background: rgb(var(--hitl) / 0.15);
}

.pt-ai-hitl-link:focus-visible {
  outline: 2px solid rgb(var(--hitl));
  outline-offset: 2px;
}

/* Cibles tactiles confortables au doigt. */
@media (pointer: coarse) {
  .pt-ai-hitl-link {
    height: 38px;
  }
}

/* Sous 360 px, l'action passe sous le libellé plutôt que de l'écraser. */
@media (max-width: 360px) {
  .pt-ai-hitl {
    grid-template-columns: 16px minmax(0, 1fr);
  }

  .pt-ai-hitl-side {
    grid-area: 3 / 1 / auto / -1;
    justify-content: flex-end;
    margin-top: 4px;
  }

  .pt-ai-hitl-detail {
    grid-area: 2 / 2 / auto / -1;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Blocs de conversation rendus localement
   Structure définie dans class-ai-blocks.php, remplie par le modèle,
   dessinée ici. Aucun balisage ne vient du modèle.
   ───────────────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────────────
   La décision en attente : le dock s'ouvre pour la porter.

   L'approbation vivait sous trois formes — deux boutons-icônes dans une
   carte de conversation, deux boutons-texte sous un plan, un sélecteur
   dans le journal — et toutes disparaissaient du regard dès que la
   réponse s'allongeait.

   Elle n'arrive pas non plus au-dessus du dock, en carte flottante : la
   pilule se déplie et la contient. Ce qu'on autorise et l'endroit où
   l'on répond forment un seul objet. La troisième issue est d'écrire :
   le champ reste vivant sous la question, et une phrase tranche aussi
   sûrement qu'un bouton.
   ───────────────────────────────────────────────────────────────────── */

.pt-ai-decision-dock[hidden] {
  display: none !important;
}

/* Le dock déplié : colonne, coins adoucis, la pilule glisse au fond.
   Il ne cède jamais : c'est la conversation qui recule devant la question. */
.pt-ai-dock-outer {
  flex-shrink: 0;
}

/* Rayons concentriques : chaque coin suit celui qu'il entoure, plus le retrait.
   En haut, la carte arrondit a 24 et se retire de 4, donc 28. En bas, la pilule
   fait 66 de haut, soit 33 de rayon, et se retire de 4, donc 37. Un rayon
   uniforme laissait le coin bas plus carre que la pilule qu'il enveloppe. */
.pt-ai-dock-outer.has-decision {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-radius: 28px 28px 37px 37px;
}

.pt-ai-dock-outer.has-decision:hover {
  transform: none;
}

.pt-ai-dock-outer.has-decision::after {
  border-radius: 28px 28px 37px 37px;
}

/* La pilule garde sa forme, elle a seulement reculé d'un cran. */
.pt-ai-dock-outer.has-decision>.pt-ai-dock {
  /* Même facteur d'étirement que la pilule (flex: 1) : avec 0, la transition
     « all » du dock animait l'étirement et le dock rétrécissait au repli. */
  flex: 1 1 auto;
  margin: 0 4px 4px;
}

/* La question se retire du même pas que la pilule : quatre pixels de chaque
   côté. Sans cela, la carte touchait le bord pendant que le champ s'en tenait
   à distance, et les deux bords verticaux ne tombaient pas l'un sur l'autre. */
.pt-ai-dock-outer.has-decision>.pt-ai-decision-dock {
  margin: 4px 4px 0;
}

.pt-ai-decision {
  min-height: 0;
  --dec: 234 179 8;
  /* ambre — en attente */
  --dec-soft: 253 235 196;

  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1px 12px;
  padding: 13px 16px 12px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(rgb(var(--dec) / 0.11), rgb(var(--dec) / 0.02));
  animation: pt-ai-decision-in 340ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pt-ai-decision[data-state="validated"] {
  --dec: 34 197 94;
  --dec-soft: 198 246 220;
}

.pt-ai-decision[data-state="rejected"],
.pt-ai-decision[data-state="failed"] {
  --dec: 239 68 68;
  --dec-soft: 254 214 214;
}

@keyframes pt-ai-decision-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pt-ai-decision {
    animation: none;
  }
}

.pt-ai-decision-mark {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--dec));
}

.pt-ai-decision-mark svg {
  width: 17px;
  height: 17px;
}

.pt-ai-decision-text {
  grid-area: 1 / 2;
  min-width: 0;
}

.pt-ai-decision-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.94);
  overflow-wrap: anywhere;
}

.pt-ai-decision-detail {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: rgb(var(--dec-soft) / 0.7);
  /* teinté sur l'état, jamais gris */
  overflow-wrap: anywhere;
}

.pt-ai-decision-actions {
  grid-area: 1 / 3;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Une carte qui fait choisir, plutot que trancher : la barre passe sous le
   texte et prend toute la largeur, sinon la liste etrangle le titre. */
.pt-ai-decision[data-layout="choice"] .pt-ai-decision-actions {
  grid-area: 4 / 1 / auto / -1;
  min-width: 0;
  margin-top: 11px;
}

.pt-ai-decision[data-layout="choice"] .pt-ai-notice-pick {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

/* Le champ porte la liste et sa pastille : la coche appartient au choix. */
.pt-ai-notice-field {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.pt-ai-notice-field .pt-ai-notice-select {
  padding-right: 44px;
}

.pt-ai-notice-field .pt-ai-notice-mark {
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Ce qu'on autorise, déroulé sous la question. Plafonné : le dock ne mange
   jamais la conversation, il en emprunte une part et rend le reste. */
/* Ce que l'action ne sait pas encore d'elle-même : posé sous la question,
   avant ce qu'elle contient. */
.pt-ai-decision-options {
  grid-area: 2 / 1 / auto / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 11px;
}

.pt-ai-decision-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgb(var(--dec-soft) / 0.72);
}

.pt-ai-decision-select {
  height: 30px;
  padding: 0 28px 0 10px;
  border: 1px solid rgb(var(--dec) / 0.4);
  border-radius: 8px;
  background-color: rgb(var(--dec) / 0.1);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  appearance: none;
  cursor: pointer;
}

.pt-ai-decision-select:focus-visible {
  outline: 2px solid rgb(var(--dec));
  outline-offset: 2px;
}

.pt-ai-decision-select option {
  background: #14141c;
  color: rgba(255, 255, 255, 0.92);
}

/* Ce qu'on autorise, déroulé sous la question. Plafonné en hauteur d'écran :
   le dock emprunte une part du viewport et rend le reste à la conversation,
   qui cède la première. Sur un écran court, il emprunte moins. */
.pt-ai-decision-body {
  grid-area: 3 / 1 / auto / -1;
  min-width: 0;
  min-height: 0;
  margin-top: 11px;
  max-height: 32vh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.pt-ai-decision-body::-webkit-scrollbar {
  width: 4px;
}

.pt-ai-decision-body::-webkit-scrollbar-track {
  background: transparent;
}

.pt-ai-decision-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

@media (max-height: 820px) {
  .pt-ai-decision-body {
    max-height: 24vh;
  }
}

@media (max-height: 620px) {
  .pt-ai-decision-body {
    max-height: 18vh;
  }
}

/* Pas de carte dans une carte : le plan se déroule à plat dans le panneau,
   et son titre ne se répète pas — c'est déjà celui de la question. */
.pt-ai-decision-plan {
  margin: 0;
}

.pt-ai-decision-plan .pt-ai-plan-lead,
.pt-ai-decision-plan .pt-ai-block-head,
.pt-ai-decision-plan .pt-ai-plan-verdict {
  display: none;
}

.pt-ai-decision-plan .pt-ai-block {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.pt-ai-decision-plan .pt-ai-block-body {
  padding: 0;
}

.pt-ai-decision-plan .pt-ai-plan-phase-name {
  color: rgb(var(--dec-soft) / 0.62);
}

.pt-ai-decision-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pt-ai-decision-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.95);
}

.pt-ai-decision-btn[data-decision="approve"] {
  border-color: rgb(var(--dec) / 0.55);
  background: rgb(var(--dec) / 0.18);
  color: rgb(var(--dec-soft));
}

.pt-ai-decision-btn[data-decision="approve"]:hover {
  background: rgb(var(--dec) / 0.3);
  color: #fff;
}

.pt-ai-decision-btn:focus-visible {
  outline: 2px solid rgb(var(--dec));
  outline-offset: 2px;
}

.pt-ai-decision-verdict {
  grid-area: 1 / 3;
  align-self: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgb(var(--dec-soft) / 0.9);
  white-space: nowrap;
}

/* Au doigt, et sur un écran étroit, les deux issues passent sous le texte. */
@media (max-width: 560px),
(pointer: coarse) {
  .pt-ai-decision {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .pt-ai-decision-mark {
    grid-area: 1 / 1;
    align-self: start;
  }

  .pt-ai-decision-text {
    grid-area: 1 / 2;
  }

  .pt-ai-decision-actions,
  .pt-ai-decision-verdict {
    grid-area: 2 / 1 / auto / -1;
    margin-top: 10px;
  }

  .pt-ai-decision-options {
    grid-area: 3 / 1 / auto / -1;
  }

  .pt-ai-decision-body {
    grid-area: 4 / 1 / auto / -1;
    max-height: 28vh;
  }

  .pt-ai-decision-select {
    height: 38px;
    flex: 1;
  }

  .pt-ai-decision-btn {
    flex: 1;
    height: 40px;
  }
}

/* Un bloc et la phrase qui le commente ne se touchent pas. */
.pt-ai-block+.pt-ai-response-content,
.pt-ai-plan-wrap+.pt-ai-response-content {
  margin-top: 12px;
}

.pt-ai-block {
  margin: 10px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.pt-ai-block-head {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pt-ai-block-icon {
  display: flex;
  color: rgba(249, 115, 22, 0.85);
  /* orange du portail */
}

.pt-ai-block-icon svg {
  width: 15px;
  height: 15px;
}

.pt-ai-block-title {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  overflow-wrap: anywhere;
}

.pt-ai-block-body {
  padding: 10px 12px;
}

.pt-ai-block-meta {
  padding-top: 0;
  font-size: 10.5px;
  color: rgba(255, 236, 214, 0.55);
  /* teinté sur l'orange, jamais gris */
}

.pt-ai-block-prose {
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  white-space: pre-wrap;
  /* les sauts de ligne survivent */
  overflow-wrap: anywhere;
}

/* Sous-ensemble markdown rendu par Blocks.prose() : rien d'autre ne peut exister. */
.pt-ai-block-prose .pt-ai-prose-h {
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}

.pt-ai-block-prose strong {
  font-weight: 650;
  color: rgba(255, 255, 255, 0.95);
}

.pt-ai-block-prose em {
  font-style: italic;
  color: rgba(255, 236, 214, 0.78);
}

.pt-ai-block-prose code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.pt-ai-block-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 6px;
  color: rgba(249, 115, 22, 0.95);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease;
}

.pt-ai-block-link svg {
  width: 13px;
  height: 13px;
}

.pt-ai-block-link:hover {
  background: rgba(249, 115, 22, 0.14);
}

.pt-ai-block-link:focus-visible {
  outline: 2px solid rgba(249, 115, 22, 0.9);
  outline-offset: 2px;
}

/* ── La référence d'un plan, en fin de phrase ──
   C'était une carte au-dessus de la prose : un objet encadré annonçant un
   autre objet encadré. Le plan se lit dans le dock tant qu'on le décide, et
   reçoit sa propre carte une fois lancé. Le fil n'a besoin que d'un nom,
   d'un état, et d'un chemin de retour. */

.pt-ai-plan-ref {
  --ref: 234 179 8;
  --ref-soft: 253 235 196;

  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.pt-ai-plan-ref[data-status="validated"] {
  --ref: 34 197 94;
  --ref-soft: 198 246 220;
}

.pt-ai-plan-ref[data-status="refused"] {
  --ref: 239 68 68;
  --ref-soft: 254 214 214;
}

/* Une panne reprise est un succes ; ignoree, elle s'efface sans disparaitre.
   « En cours » garde l'ambre de l'attente : rien n'est encore acquis. */
.pt-ai-plan-ref[data-status="done"] {
  --ref: 34 197 94;
  --ref-soft: 198 246 220;
}

.pt-ai-plan-ref[data-status="failed"] {
  --ref: 239 68 68;
  --ref-soft: 254 214 214;
}

.pt-ai-plan-ref[data-status="ignored"] {
  --ref: 148 163 184;
  --ref-soft: 226 232 240;
}

.pt-ai-plan-ref-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.78);
}

/* Le nom de l'action, en texte courant : l'identifiant le précède, en chasse
   fixe, parce qu'on le cite ; le nom se lit. */
.pt-ai-plan-ref-label {
  color: rgba(255, 255, 255, 0.84);
}

.pt-ai-plan-ref-label::before {
  content: '·';
  margin-right: 7px;
  color: rgba(255, 255, 255, 0.25);
}

.pt-ai-plan-ref-state {
  color: rgb(var(--ref-soft) / 0.72);
  /* teinté sur l'état, jamais gris */
}

.pt-ai-plan-ref-state::before {
  content: '·';
  margin-right: 7px;
  color: rgba(255, 255, 255, 0.25);
}

.pt-ai-plan-ref-open {
  padding: 0;
  border: 0;
  background: none;
  color: rgb(var(--ref) / 0.95);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgb(var(--ref) / 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.16s ease;
}

.pt-ai-plan-ref-open::before {
  content: '·';
  margin-right: 7px;
  color: rgba(255, 255, 255, 0.25);
  text-decoration: none;
  display: inline-block;
}

.pt-ai-plan-ref-open:hover {
  text-decoration-color: rgb(var(--ref));
}

.pt-ai-plan-ref-open:focus-visible {
  outline: 2px solid rgb(var(--ref));
  outline-offset: 3px;
}

.pt-ai-btn-open-canvas,
.pt-ai-btn-open-canvas.pt-ai-plan-ref-open,
.pt-ai-action-ref .pt-ai-btn-open-canvas,
.pt-ai-action-ref .pt-ai-plan-ref-open {
  text-decoration: none !important;
}

.pt-ai-btn-open-canvas::before,
.pt-ai-btn-open-canvas.pt-ai-plan-ref-open::before,
.pt-ai-action-ref .pt-ai-btn-open-canvas::before,
.pt-ai-action-ref .pt-ai-plan-ref-open::before {
  content: none !important;
  display: none !important;
}

/* ── Choisir un autre modèle depuis l'avis lui-même ──
   Constater un blocage puis renvoyer ailleurs pour le lever fait faire le
   chemin deux fois. Le remède se prend là où le problème s'annonce, et la
   pastille à droite dit si le nouveau modèle répondra vraiment. */

.pt-ai-notice-pick {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.pt-ai-notice-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  height: 28px;
  padding: 0 26px 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.55' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  text-overflow: ellipsis;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.pt-ai-notice-select:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
}

.pt-ai-notice-select:disabled {
  opacity: 0.55;
  cursor: progress;
}

.pt-ai-notice-select:focus-visible {
  outline: 2px solid rgba(249, 115, 22, 0.9);
  outline-offset: 2px;
}

.pt-ai-notice-select option {
  background: #14141c;
  color: rgba(255, 255, 255, 0.92);
}

.pt-ai-notice-mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pt-ai-notice-mark svg {
  width: 13px;
  height: 13px;
}

.pt-ai-notice-mark[data-state="idle"] {
  visibility: hidden;
}

.pt-ai-notice-mark[data-state="busy"] {
  color: rgba(255, 255, 255, 0.55);
  animation: pt-ai-mark-spin 0.9s linear infinite;
}

.pt-ai-notice-mark[data-state="ok"] {
  color: #22c55e;
}

.pt-ai-notice-mark[data-state="bad"] {
  color: #ef4444;
}

@keyframes pt-ai-mark-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pt-ai-notice-mark[data-state="busy"] {
    animation-duration: 2.4s;
  }
}

.pt-ai-notice-resume {
  flex-shrink: 0;
  height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.16);
  color: rgba(198, 246, 220, 0.98);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.pt-ai-notice-resume:hover {
  background: rgba(34, 197, 94, 0.28);
  color: #fff;
}

.pt-ai-notice-resume[hidden] {
  display: none !important;
}

.pt-ai-notice-resume:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

@media (pointer: coarse) {

  .pt-ai-notice-select,
  .pt-ai-notice-resume {
    height: 34px;
  }
}

/* ── Le plan en cours, réduit à son avancement ──
   Il occupait une carte dans la conversation, qui défilait hors de vue dès la
   deuxième réponse — précisément quand on commence à se demander où en est le
   travail. Ici il tient à côté du bouton d'envoi, gros comme lui, et ne parle
   que d'une chose : combien de tâches sont faites. */

.pt-ai-plan-pill[hidden],
.pt-ai-plan-popover[hidden],
.pt-ai-validation-pill[hidden],
.pt-ai-paused-pill[hidden] {
  display: none !important;
}

.pt-ai-validation-pill,
.pt-ai-paused-pill {
  --val-pill: 245 158 11;

  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1.5px solid rgb(var(--val-pill) / 0.45);
  border-radius: 50%;
  background: rgb(var(--val-pill) / 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--val-pill));
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 10px rgb(var(--val-pill) / 0.18);
  margin-right: 2px;
}

.pt-ai-validation-pill:hover,
.pt-ai-paused-pill:hover {
  background: rgb(var(--val-pill) / 0.22);
  border-color: rgb(var(--val-pill) / 0.85);
  transform: scale(1.08);
  box-shadow: 0 0 16px rgb(var(--val-pill) / 0.35);
}

.pt-ai-validation-pill:focus-visible,
.pt-ai-paused-pill:focus-visible {
  outline: 2px solid rgb(var(--val-pill));
  outline-offset: 3px;
}

.pt-ai-validation-pill .pt-ai-validation-pill-inner,
.pt-ai-paused-pill .pt-ai-paused-pill-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.pt-ai-validation-pill .pt-ai-validation-pill-count {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: rgb(var(--val-pill));
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
}

.pt-ai-validation-pill-pulse,
.pt-ai-paused-pill-pulse {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  animation: pt-ai-pulse-dot 1.8s infinite;
}

@keyframes pt-ai-pulse-dot {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
}

/* Session Item Pending Banner & Chips */
.pt-ai-sess-pending-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 3px 0;
}

.pt-ai-sess-pending-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.pt-ai-sess-expire-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pt-ai-sess-expire-chip.is-urgent {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
}



.pt-ai-session-item.has-pending-validation,
.pt-ai-session-item.has-attention {
  background: rgba(245, 158, 11, 0.05) !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

.pt-ai-session-item.has-pending-validation:hover,
.pt-ai-session-item.has-attention:hover {
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
}

/* Attention Banner & Badges in Session Item */
.pt-ai-sess-attention-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 3px 0 1px 0;
}

.pt-ai-sess-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  transition: all 0.15s ease;
  white-space: nowrap;
}

/* Badges de Plan */
.pt-ai-sess-badge.badge-plan-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.pt-ai-sess-badge.badge-plan-interrupted {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pt-ai-sess-badge.badge-plan-paused {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.pt-ai-sess-badge.badge-plan-running {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Badges d'Actions sensibles HITL */
.pt-ai-sess-badge.badge-action-email {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.pt-ai-sess-badge.badge-action-ticket {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.pt-ai-sess-badge.badge-action-notif {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.pt-ai-sess-badge.badge-action-project {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.pt-ai-sess-badge.badge-action-task {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.4);
}

.pt-ai-sess-badge.badge-action-other {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.pt-ai-sess-badge.badge-generating {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

/* Attention Filter Bar */
.pt-ai-attention-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
  font-size: 11px;
}

.pt-ai-clear-attention-filter {
  background: transparent;
  border: none;
  color: #fbbf24;
  text-decoration: underline;
  cursor: pointer;
  font-size: 10px;
  padding: 0;
  transition: opacity 0.15s ease;
}

.pt-ai-clear-attention-filter:hover {
  opacity: 0.8;
  color: #fff;
}

html:not(.dark) .pt-ai-sess-badge.badge-plan-pending {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.35);
}

html:not(.dark) .pt-ai-sess-badge.badge-plan-interrupted {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.35);
}

html:not(.dark) .pt-ai-sess-badge.badge-action-email {
  background: rgba(79, 70, 229, 0.12);
  color: #4338ca;
  border-color: rgba(79, 70, 229, 0.35);
}

html:not(.dark) .pt-ai-sess-badge.badge-action-ticket {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
  border-color: rgba(234, 88, 12, 0.35);
}

html:not(.dark) .pt-ai-sess-badge.badge-action-notif {
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
  border-color: rgba(147, 51, 234, 0.35);
}

.pt-ai-plan-pill {
  --pill: 249 115 22;

  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgb(var(--pill) / 0.3);
  border-radius: 50%;
  background: rgb(var(--pill) / 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pt-ai-plan-pill:hover {
  background: rgb(var(--pill) / 0.18);
  transform: scale(1.06);
}

.pt-ai-plan-pill:focus-visible {
  outline: 2px solid rgb(var(--pill));
  outline-offset: 3px;
}

.pt-ai-plan-pill[data-state="done"] {
  --pill: 34 197 94;
}

.pt-ai-plan-pill[data-state="error"] {
  --pill: 239 68 68;
}

/* Arrete : ni fini, ni en train d'avancer. L'ambre dit l'attente, et le contour
   plein la distingue du cercle discret d'une progression normale. */
.pt-ai-plan-pill[data-state="stalled"] {
  --pill: 234 179 8;
  border-color: rgb(var(--pill) / 0.7);
  background: rgb(var(--pill) / 0.16);
}

.pt-ai-plan-pill.is-entering {
  animation: pt-ai-pill-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes pt-ai-pill-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pt-ai-plan-pill.is-entering {
    animation: none;
  }
}

.pt-ai-plan-pill-ring {
  position: absolute;
  inset: 1px;
  transform: rotate(-90deg);
  /* le zéro en haut, comme une horloge */
}

.pt-ai-plan-pill-track,
.pt-ai-plan-pill-active,
.pt-ai-plan-pill-value {
  fill: none;
  stroke-width: 2.5;
}

.pt-ai-plan-pill-track {
  stroke: rgba(255, 255, 255, 0.1);
}

/* Le vert : ce qui est acquis. Il passe par-dessus l'orange, donc l'orange ne
   reste visible que sur la part qui n'est pas encore terminee. */
.pt-ai-plan-pill-value {
  stroke: #22c55e;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s ease;
}

/* L'orange : la tache en cours. Elle bat, parce qu'elle est la seule chose qui
   bouge — un anneau fixe ne distingue pas un travail en cours d'un travail
   arrete, et c'est exactement la distinction qui manquait. */
.pt-ai-plan-pill-active {
  stroke: rgb(249 115 22);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pt-ai-pulse 1.6s ease-in-out infinite;
}

.pt-ai-plan-pill[data-state="done"] .pt-ai-plan-pill-active,
.pt-ai-plan-pill[data-state="error"] .pt-ai-plan-pill-active {
  display: none;
}

/* Arrete : l'arc cesse de battre. C'est ce que veut dire « arrete ». */
.pt-ai-plan-pill[data-state="stalled"] .pt-ai-plan-pill-active {
  stroke: rgb(234 179 8);
  animation: none;
  opacity: 0.55;
}

@keyframes pt-ai-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.pt-ai-plan-pill-count {
  position: relative;
  font-size: 9.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.9);
}

/* Le plan lui-même, ouvert par-dessus le dock.
   La carte ne défile pas : seules les phases le font. Le titre nomme le plan
   qu'on est en train de lire — le faire disparaître au premier geste laisse
   une liste de tâches sans sujet. */
.pt-ai-plan-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  max-height: 46vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: #12121a;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.95);
  z-index: 30;
  animation: pt-ai-decision-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Pas de carte dans une carte : le plan se déroule à plat. */
.pt-ai-plan-popover .pt-ai-plan-lead,
.pt-ai-plan-popover .pt-ai-plan-verdict {
  display: none;
}

.pt-ai-plan-popover .pt-ai-plan-wrap,
.pt-ai-plan-popover .pt-ai-block {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

/* L'etat du plan, dans son en-tete fixe : visible quoi qu'on fasse defiler. */
.pt-ai-plan-state {
  --state: 249 115 22;

  margin-left: auto;
  flex: none;
  padding: 2px 8px;
  border: 1px solid rgb(var(--state) / 0.4);
  border-radius: 999px;
  background: rgb(var(--state) / 0.12);
  color: rgb(var(--state));
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.pt-ai-plan-popover[data-plan-state="done"] .pt-ai-plan-state {
  --state: 34 197 94;
}

.pt-ai-plan-popover[data-plan-state="error"] .pt-ai-plan-state {
  --state: 239 68 68;
}

.pt-ai-plan-popover[data-plan-state="stalled"] .pt-ai-plan-state {
  --state: 234 179 8;
}

.pt-ai-plan-popover[data-plan-state="running"] .pt-ai-plan-state {
  animation: pt-ai-pulse 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pt-ai-plan-popover[data-plan-state="running"] .pt-ai-plan-state {
    animation: none;
  }
}

.pt-ai-plan-popover .pt-ai-block-head {
  flex: 0 0 auto;
  padding: 13px 16px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #12121a;
}

.pt-ai-plan-popover .pt-ai-block-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 16px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

/* Un trait, pas une gouttière : la barre par défaut mange seize pixels de
   largeur utile dans une carte qui en fait trois cent quatre-vingts. */
.pt-ai-plan-popover .pt-ai-block-body::-webkit-scrollbar {
  width: 4px;
}

.pt-ai-plan-popover .pt-ai-block-body::-webkit-scrollbar-track {
  background: transparent;
}

.pt-ai-plan-popover .pt-ai-block-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.pt-ai-plan-popover .pt-ai-block-body:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.26);
}

@media (max-height: 620px) {
  .pt-ai-plan-popover {
    max-height: 38vh;
  }
}

/* ── Le registre des envois ──
   Un email et une notification sont les seules choses ici qui atteignent
   quelqu'un dehors et qu'on ne rattrape pas. Lire la conversation pour savoir
   ce qui est parti, c'est faire confiance à un récit. Ceci est une liste. */

.pt-ai-comm-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
}

.pt-ai-comm {
  --comm: 249 115 22;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.pt-ai-comm[data-kind="push"] {
  --comm: 129 140 248;
}

.pt-ai-comm-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt-ai-comm-icon {
  display: flex;
  color: rgb(var(--comm) / 0.9);
}

.pt-ai-comm-icon svg {
  width: 15px;
  height: 15px;
}

.pt-ai-comm-code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
}

.pt-ai-comm-state {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(253, 224, 71, 0.85);
  /* en attente */
}

.pt-ai-comm-state[data-state="done"] {
  color: rgba(134, 239, 172, 0.85);
}

.pt-ai-comm-state[data-state="rejected"],
.pt-ai-comm-state[data-state="failed"] {
  color: rgba(252, 165, 165, 0.85);
}

/* Arrivée depuis le fil : la carte se signale, puis se tait. */
.pt-ai-comm.is-found {
  border-color: rgb(var(--comm) / 0.55);
  background: rgb(var(--comm) / 0.08);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.pt-ai-comm-title {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
  overflow-wrap: anywhere;
}

.pt-ai-comm-meta {
  margin: 3px 0 0;
  font-size: 10.5px;
  color: rgb(var(--comm) / 0.62);
  /* teinté sur la famille, jamais gris */
}

/* Le contenu réel, celui qui partira — replié, pour que la liste reste une
   liste. Ouvert, il ne dépasse jamais 80 % de la hauteur d'écran. */
.pt-ai-comm-toggle {
  margin-top: 9px;
  padding: 0;
  border: 0;
  background: none;
  color: rgb(var(--comm) / 0.95);
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgb(var(--comm) / 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.16s ease;
}

.pt-ai-comm-toggle:hover {
  text-decoration-color: rgb(var(--comm));
}

.pt-ai-comm-toggle:focus-visible {
  outline: 2px solid rgb(var(--comm));
  outline-offset: 3px;
}

.pt-ai-comm-body[hidden] {
  display: none !important;
}

.pt-ai-comm-body {
  margin-top: 9px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  max-height: 80vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 11.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.76);
  white-space: pre-wrap;
  /* les sauts de ligne survivent */
  overflow-wrap: anywhere;
}

/* Une barre de défilement discrète : le message est le sujet, pas son cadre. */
.pt-ai-comm-body::-webkit-scrollbar {
  width: 4px;
}

.pt-ai-comm-body::-webkit-scrollbar-track {
  background: transparent;
}

.pt-ai-comm-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
}

.pt-ai-comm-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
}

.pt-ai-comm-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

/* ── La mise en forme d'un texte rédigé par le modèle ──
   Titres, gras, italique, code, puces, numéros, liens : la liste est fermée,
   et rien de ce que le modèle écrit ne peut s'y ajouter. */

.pt-ai-prose-h,
.pt-ai-block-prose .pt-ai-prose-h {
  display: inline-block;
  margin-top: 2px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
}

.pt-ai-prose-h[data-level="1"] {
  font-size: 14px;
  letter-spacing: -0.01em;
}

.pt-ai-prose-h[data-level="2"] {
  font-size: 13px;
}

.pt-ai-prose-h[data-level="3"] {
  font-size: 12.5px;
}

.pt-ai-prose-h[data-level="4"] {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
}

.pt-ai-prose-bullet,
.pt-ai-prose-num {
  display: inline-block;
  min-width: 14px;
  color: rgba(255, 255, 255, 0.4);
  font-variant-numeric: tabular-nums;
}

.pt-ai-prose-num {
  min-width: 18px;
  font-weight: 600;
}

.pt-ai-prose-link {
  display: inline-flex;
  align-items: baseline;
  padding: 1px 7px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 5px;
  color: rgba(255, 176, 118, 0.98);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease;
}

.pt-ai-prose-link:hover {
  background: rgba(249, 115, 22, 0.16);
  color: #fff;
}

.pt-ai-prose-link:focus-visible {
  outline: 2px solid rgba(249, 115, 22, 0.9);
  outline-offset: 2px;
}

/* ── Plan ── */

.pt-ai-plan-phase+.pt-ai-plan-phase {
  margin-top: 12px;
}

.pt-ai-plan-phase-name {
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 236, 214, 0.6);
}

.pt-ai-plan-tasks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-ai-plan-task {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: baseline;
  gap: 9px;
  padding: 3px 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
}

.pt-ai-plan-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Le point d'une tache en cours bat au meme rythme que l'anneau : c'est le
   meme travail, vu de deux endroits. */
.pt-ai-plan-task[data-status="running"] .pt-ai-plan-dot {
  background: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
  animation: pt-ai-dot-pulse 1.6s ease-in-out infinite;
}

@keyframes pt-ai-dot-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
    opacity: 1;
  }

  50% {
    box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.05);
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {

  .pt-ai-plan-pill-active,
  .pt-ai-plan-task[data-status="running"] .pt-ai-plan-dot {
    animation: none;
  }
}

.pt-ai-plan-task[data-status="completed"] .pt-ai-plan-dot {
  background: #22c55e;
}

.pt-ai-plan-task[data-status="error"] .pt-ai-plan-dot {
  background: #ef4444;
}

/* Tâche laissée en plan : le point est creux, comme l'information. */
.pt-ai-plan-task[data-status="unknown"] .pt-ai-plan-dot {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(250, 204, 21, 0.75);
}

.pt-ai-plan-task[data-status="unknown"] .pt-ai-plan-label {
  color: rgba(253, 224, 71, 0.75);
}

.pt-ai-plan-task[data-status="completed"] .pt-ai-plan-label {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.22);
}

/* Un plan s'ouvre sur une phrase : une carte seule se lit comme un bug. */
.pt-ai-plan-lead {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.pt-ai-plan-wrap .pt-ai-block {
  margin-top: 8px;
}

.pt-ai-plan-verdict {
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pt-ai-plan-verdict[data-verdict="pending"] {
  color: rgba(253, 224, 71, 0.8);
}

.pt-ai-plan-verdict[data-verdict="validated"] {
  color: rgba(134, 239, 172, 0.85);
}

.pt-ai-plan-verdict[data-verdict="refused"] {
  color: rgba(252, 165, 165, 0.85);
}

.pt-ai-block-diagram {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (pointer: coarse) {
  .pt-ai-block-link {
    height: 36px;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Message système dans la conversation
   Émis par le serveur, jamais par le modèle. Sert quand la réponse qui
   arrive induirait en erreur — un modèle sans outils à qui l'on demande
   de créer un ticket répondra un paragraphe fluide, et rien d'autre.
   ───────────────────────────────────────────────────────────────────── */

.pt-ai-notice {
  --notice: 234 179 8;
  --notice-soft: 253 235 196;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 9px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgb(var(--notice) / 0.3);
  border-radius: 8px;
  background: rgb(var(--notice) / 0.07);
}

.pt-ai-notice[data-level="error"] {
  --notice: 239 68 68;
  --notice-soft: 254 214 214;
}

.pt-ai-notice[data-level="info"] {
  --notice: 59 130 246;
  --notice-soft: 205 226 254;
}

.pt-ai-notice-icon {
  display: flex;
  align-items: center;
  height: 17px;
  color: rgb(var(--notice));
}

.pt-ai-notice-icon svg {
  width: 15px;
  height: 15px;
}

.pt-ai-notice-text {
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgb(var(--notice-soft) / 0.72);
  overflow-wrap: anywhere;
}

.pt-ai-notice-title {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 17px;
  color: rgba(255, 255, 255, 0.92);
}

.pt-ai-notice-action {
  margin-top: 5px;
  font-weight: 600;
  color: rgb(var(--notice));
}

/* Un bloc systeme se tient seul : ce que la machine dit d'elle-meme n'est pas
   une reponse, et n'a ni auteur, ni bouton copier, ni regeneration. */
.pt-ai-system-row {
  display: flex;
  margin: 12px 0;
}

.pt-ai-system-row>.pt-ai-notice {
  flex: 1;
  min-width: 0;
  margin: 0;
}

/* Le remede, dans le dock : ce qu'il faut lire, puis ce qu'il faut choisir. */
.pt-ai-remedy {
  min-width: 0;
  max-width: 100%;
}

.pt-ai-remedy-text {
  margin: 0 0 9px;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(253, 235, 196, 0.72);
}

.pt-ai-remedy>.pt-ai-notice-pick {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  flex-wrap: nowrap;
}

/* Un tour qui n'a rien repondu le dit, en retrait : ce n'est pas une reponse,
   c'est un constat sur la reponse qui manque. */
.pt-ai-empty-answer {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  font-style: italic;
  color: rgba(253, 235, 196, 0.6);
}

/* La trace d'une panne se lit comme la reference d'un plan : meme ligne, meme
   grammaire. Elle ajoute seulement de quoi nommer ce qui a change. */
.pt-ai-plan-ref-label {
  color: rgba(255, 255, 255, 0.5);
}

.pt-ai-system-ref-open {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: rgb(var(--ref) / 0.9);
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.pt-ai-system-ref-open:hover {
  color: rgb(var(--ref));
}

.pt-ai-system-ref-open:focus-visible {
  outline: 2px solid rgb(var(--ref));
  outline-offset: 2px;
  border-radius: 3px;
}

/* ─────────────────────────────────────────────────────────────────────
   Fiche du modèle, dans l'en-tête du chat
   ───────────────────────────────────────────────────────────────────── */

.pt-ai-noact {
  flex: none;
  padding: 1px 6px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 9px;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: help;
}

.pt-ai-model-card {
  /*
     * Fixed and body-level: inside the header it was clipped by an ancestor.
     *
     * Above the chat panel itself (2000000) and its continuity modal (3500000),
     * otherwise the card opens behind the very widget that triggered it.
     */
  position: fixed;
  z-index: 3500001;
  width: min(320px, calc(100vw - 32px));
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #14141b;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.pt-ai-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}

.pt-ai-card-slug {
  margin-top: 1px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.35);
  overflow-wrap: anywhere;
}

.pt-ai-card-desc {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 236, 214, 0.6);
}

.pt-ai-card-body {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.pt-ai-card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  font-size: 11px;
  line-height: 1.5;
}

.pt-ai-card-key {
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.pt-ai-card-val {
  color: rgba(255, 255, 255, 0.82);
  text-align: right;
  overflow-wrap: anywhere;
}

.pt-ai-card-warn {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 10.5px;
  line-height: 1.5;
  color: #f87171;
}

/* ==========================================================================
   Phase 4: Generative UI Blocks, Visual Diffs & Cognitive Controls
   ========================================================================== */

/* 1. Interactive Kanban Board */
.pt-ai-kanban-board {
  display: flex;
  gap: 10px;
  margin: 10px 0;
  overflow-x: auto;
  padding-bottom: 6px;
}

.pt-ai-kanban-col {
  flex: 1;
  min-width: 170px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.pt-ai-kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pt-ai-kanban-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
}

.pt-ai-kanban-col-count {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.pt-ai-kanban-col-items {
  min-height: 100px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.2s ease, border 0.2s ease;
  border-radius: 6px;
}

.pt-ai-kanban-col-items.drag-hover {
  background: rgba(249, 115, 22, 0.08);
  outline: 2px dashed rgba(249, 115, 22, 0.4);
  outline-offset: -2px;
}

.pt-ai-kanban-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: grab;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pt-ai-kanban-card:hover {
  border-color: rgba(249, 115, 22, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pt-ai-kanban-card:active {
  cursor: grabbing;
}

.pt-ai-kanban-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.pt-ai-kanban-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #f97316;
}

.pt-ai-kanban-prio {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.pt-ai-kanban-prio.prio-urgent {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.pt-ai-kanban-prio.prio-high {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
}

.pt-ai-kanban-prio.prio-medium {
  background: rgba(234, 179, 8, 0.18);
  color: #facc15;
}

.pt-ai-kanban-prio.prio-low {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.pt-ai-kanban-card-title {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.35;
  word-break: break-word;
}

.pt-ai-kanban-card-foot {
  margin-top: 6px;
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.4);
}

/* 2. Statistical Charts Container */
.pt-ai-chart-container {
  width: 100%;
  min-height: 200px;
  position: relative;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pt-ai-chart-container canvas {
  max-height: 240px;
  width: 100% !important;
}

/* 3. Actionable Deliverable Toolbar */

.pt-ai-deliv-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pt-ai-deliv-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.pt-ai-deliv-btn.highlight {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(234, 88, 12, 0.2));
  border-color: rgba(249, 115, 22, 0.4);
  color: #fb923c;
}

.pt-ai-deliv-btn.highlight:hover {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.35), rgba(234, 88, 12, 0.35));
  border-color: rgba(249, 115, 22, 0.6);
  color: #ffffff;
}

/* 4. Visual Diff Comparator ("Avant / Après") */
.pt-ai-diff-container {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.pt-ai-diff-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.pt-ai-diff-row {
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pt-ai-diff-row:last-child {
  border-bottom: none;
}

.pt-ai-diff-label {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.pt-ai-diff-del {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px 0;
  display: block;
}

.pt-ai-diff-add {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px 0;
  display: block;
}

/* 5. Interactive Citation Badges */
.pt-ai-citation-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 12px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: #fb923c;
  font-size: 10px;
  font-weight: 600;
  margin: 0 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
}

.pt-ai-citation-badge:hover {
  background: rgba(249, 115, 22, 0.25);
  border-color: rgba(249, 115, 22, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}

/* 6. Message Action Buttons (Edit / Retry) */
.pt-ai-action-btn {
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  margin-top: 4px;
}

.pt-ai-message:hover .pt-ai-action-btn {
  opacity: 1;
}

.pt-ai-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* ==========================================================================
   AURA VISION 5.0 : AURA CANVAS STUDIO & SPLIT-SCREEN WORKSPACE
   ========================================================================== */

.pt-ai-dock-wrapper.pt-ai-canvas-active {
  position: fixed !important;
  top: 10px !important;
  left: 10px !important;
  right: 10px !important;
  bottom: 10px !important;
  width: calc(100vw - 20px) !important;
  max-width: calc(100vw - 20px) !important;
  height: calc(100vh - 20px) !important;
  max-height: calc(100vh - 20px) !important;
  transform: none !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  align-items: center !important;
  padding-bottom: 12px !important;
  z-index: 1999999 !important;
  pointer-events: none !important;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#pt-ai-response-zone.pt-ai-canvas-open {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 20px !important;
  margin: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 50px rgba(99, 102, 241, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  overflow: hidden !important;
  pointer-events: auto !important;
  z-index: 10 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Hide legacy accordion header when Canvas workspace is active */
#pt-ai-response-zone.pt-ai-canvas-open .pt-ai-response-header {
  display: none !important;
}

/* Previews in Canvas Mode: strictly centered like the dock */
.pt-ai-dock-wrapper.pt-ai-canvas-active #pt-ai-image-previews {
  position: relative !important;
  width: 100% !important;
  max-width: 750px !important;
  margin: 0 auto 10px auto !important;
  flex-shrink: 0 !important;
  z-index: 30 !important;
  pointer-events: auto !important;
}

/* Floating AI Dock in Canvas Mode: strictly centered */
.pt-ai-dock-wrapper.pt-ai-canvas-active .pt-ai-dock-outer {
  width: 100% !important;
  max-width: 750px !important;
  margin: 0 auto !important;
  flex-shrink: 0 !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 30 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 30px rgba(249, 115, 22, 0.2) !important;
}

/* Content padding inside response zone so scrolling goes past floating dock */
.pt-ai-dock-wrapper.pt-ai-canvas-active .pt-ai-canvas-chat-pane #pt-ai-chat-content {
  padding-bottom: 90px !important;
}

.pt-ai-dock-wrapper.pt-ai-canvas-active #pt-ai-response-zone.pt-ai-has-previews .pt-ai-canvas-chat-pane #pt-ai-chat-content {
  padding-bottom: 180px !important;
}

.pt-ai-dock-wrapper.pt-ai-canvas-active #pt-ai-canvas-workspace .pt-ai-canvas-body {
  padding-bottom: 160px !important;
}

.pt-ai-dock-wrapper.pt-ai-canvas-active #pt-ai-response-zone.pt-ai-has-previews #pt-ai-canvas-workspace .pt-ai-canvas-body {
  padding-bottom: 240px !important;
}

/* Canvas Footer sits cleanly above floating dock */
.pt-ai-dock-wrapper.pt-ai-canvas-active .pt-ai-canvas-footer {
  position: relative !important;
  z-index: 20 !important;
  margin-bottom: 74px !important;
}

.pt-ai-dock-wrapper.pt-ai-canvas-active #pt-ai-response-zone.pt-ai-has-previews .pt-ai-canvas-footer {
  margin-bottom: 165px !important;
}

/* Fullscreen Canvas Mode */
#pt-ai-response-zone.pt-ai-canvas-fullscreen {
  position: fixed !important;
  top: 10px !important;
  left: 10px !important;
  right: 10px !important;
  bottom: 10px !important;
  width: calc(100vw - 20px) !important;
  max-width: calc(100vw - 20px) !important;
  height: calc(100vh - 20px) !important;
  max-height: calc(100vh - 20px) !important;
  z-index: 2000000 !important;
  border-radius: 20px !important;
}

/* Hidden state when Canvas is NOT active */
#pt-ai-response-zone:not(.pt-ai-canvas-open) #pt-ai-canvas-workspace,
#pt-ai-response-zone:not(.pt-ai-canvas-open) #pt-ai-canvas-resizer {
  display: none !important;
}

#pt-ai-response-zone:not(.pt-ai-canvas-open) .pt-ai-canvas-chat-pane {
  flex: 1 1 100% !important;
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  border-right: none !important;
  background: transparent !important;
}

#pt-ai-response-zone:not(.pt-ai-canvas-open) .pt-ai-canvas-split-container {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

/* Split Container */
.pt-ai-canvas-split-container {
  display: flex !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  position: relative !important;
  box-sizing: border-box !important;
}

/* Left Pane: Chat Column */
.pt-ai-canvas-chat-pane {
  flex: 0 0 38% !important;
  min-width: 280px !important;
  max-width: 65% !important;
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(10, 10, 15, 0.4) !important;
  box-sizing: border-box !important;
}

.pt-ai-canvas-chat-pane .pt-ai-main-tabs-nav {
  flex: 0 0 auto !important;
  width: 100% !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.pt-ai-canvas-chat-pane #pt-ai-main-tabs-container {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* Draggable Resizer */
#pt-ai-canvas-resizer {
  width: 8px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 40;
  margin: 0 -4px;
  flex-shrink: 0;
}

#pt-ai-canvas-resizer:hover,
#pt-ai-canvas-resizer.is-dragging {
  background: rgba(249, 115, 22, 0.6);
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.8);
}

/* Right Pane: Canvas Workspace */
#pt-ai-canvas-workspace {
  flex: 1 1 62% !important;
  min-width: 300px !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  background: rgba(13, 13, 18, 0.95) !important;
  backdrop-filter: blur(40px) !important;
  -webkit-backdrop-filter: blur(40px) !important;
  overflow: hidden !important;
  position: relative !important;
  box-sizing: border-box !important;
  pointer-events: auto !important;
}

/* Canvas Header with Anti-Collision Flex rules */
.pt-ai-canvas-header {
  height: 48px !important;
  min-height: 48px !important;
  flex: 0 0 48px !important;
  padding: 0 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  background: rgba(0, 0, 0, 0.5) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.pt-ai-canvas-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.pt-ai-canvas-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  min-width: 0;
  flex-shrink: 1;
}

.pt-ai-canvas-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #fb923c;
  flex-shrink: 0;
}

.pt-ai-canvas-badge[data-type="sheet"] {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.pt-ai-canvas-badge[data-type="code"] {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

.pt-ai-canvas-badge[data-type="gantt"] {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(236, 72, 153, 0.35);
  color: #f472b6;
}

/* Presence Pills (Multiplayer) */
.pt-ai-canvas-presence-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  flex-shrink: 0;
}

.pt-ai-canvas-presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
  white-space: nowrap;
}

.pt-ai-canvas-presence-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Canvas Action Buttons */
.pt-ai-canvas-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.pt-ai-canvas-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pt-ai-canvas-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

.pt-ai-canvas-action-btn.accent-pdf:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.pt-ai-canvas-action-btn.accent-xlsx:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

/* Canvas Body Editor & Viewer */
.pt-ai-canvas-body,
#pt-ai-canvas-body-content {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 36px 48px 160px 48px !important;
  box-sizing: border-box !important;
  color: #cbd5e1 !important;
  font-size: 14px !important;
  line-height: 1.75 !important;
  outline: none !important;
  pointer-events: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(249, 115, 22, 0.4) rgba(255, 255, 255, 0.05) !important;
}

.pt-ai-canvas-body::-webkit-scrollbar,
#pt-ai-canvas-body-content::-webkit-scrollbar {
  width: 6px !important;
}

.pt-ai-canvas-body::-webkit-scrollbar-track,
#pt-ai-canvas-body-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02) !important;
  border-radius: 9999px !important;
}

.pt-ai-canvas-body::-webkit-scrollbar-thumb,
#pt-ai-canvas-body-content::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.35) !important;
  border-radius: 9999px !important;
}

.pt-ai-canvas-body::-webkit-scrollbar-thumb:hover,
#pt-ai-canvas-body-content::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.65) !important;
}

.pt-ai-canvas-body[contenteditable="true"] {
  cursor: text;
  background: rgba(255, 255, 255, 0.01);
}

.pt-ai-canvas-body h1 {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  margin: 0 0 20px 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding-bottom: 10px !important;
  letter-spacing: -0.02em !important;
}

.pt-ai-canvas-body h2 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  margin: 28px 0 14px 0 !important;
  letter-spacing: -0.01em !important;
}

.pt-ai-canvas-body h3 {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #e2e8f0 !important;
  margin: 22px 0 10px 0 !important;
}

.pt-ai-canvas-body p {
  margin-bottom: 16px !important;
}

.pt-ai-canvas-body ul,
.pt-ai-canvas-body ol {
  margin: 0 0 18px 24px !important;
  padding: 0 !important;
}

.pt-ai-canvas-body li {
  margin-bottom: 8px !important;
  line-height: 1.7 !important;
}

.pt-ai-canvas-body .pt-ai-list {
  margin: 16px 0 20px 0 !important;
  padding-left: 8px !important;
}

.pt-ai-canvas-body .pt-ai-list li {
  padding-left: 28px !important;
  margin-bottom: 8px !important;
}

.pt-ai-canvas-body .pt-ai-table-wrapper {
  margin: 20px 0 !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(0, 0, 0, 0.25) !important;
}

.pt-ai-canvas-body .pt-ai-table,
.pt-ai-canvas-body table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 12.5px !important;
}

/* Interactive Table in Canvas */
.pt-ai-canvas-sheet-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pt-ai-canvas-sheet-table th,
.pt-ai-canvas-sheet-table td {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.pt-ai-canvas-sheet-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.pt-ai-canvas-sheet-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Code Studio in Canvas */
.pt-ai-code-studio {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(10, 15, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}
.pt-ai-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pt-ai-code-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  font-family: monospace;
}
.pt-ai-code-meta {
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  margin-left: 10px;
}
.pt-ai-code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pt-ai-code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.pt-ai-code-copy-btn.is-copied {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}
.pt-ai-code-body {
  display: flex;
  flex: 1;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}
.pt-ai-code-gutter {
  padding: 12px 10px 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.25);
  user-select: none;
  text-align: right;
  min-width: 38px;
}
.pt-canvas-line-num {
  display: block;
}
.pt-ai-code-pre {
  margin: 0;
  padding: 12px 16px;
  color: #e2e8f0;
  flex: 1;
  background: transparent;
  overflow-x: auto;
}

/* Sheet Studio */
.pt-ai-sheet-studio {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.pt-ai-sheet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.pt-ai-sheet-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 12px;
  color: rgba(255, 255, 255, 0.4);
  flex: 1;
  max-width: 320px;
}
.pt-ai-sheet-search {
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 12px;
  outline: none;
  width: 100%;
}
.pt-ai-sheet-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pt-ai-sheet-counter {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
}
.pt-ai-sheet-export-csv {
  padding: 5px 12px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}
.pt-ai-sheet-export-csv:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #ffffff;
}
.pt-sheet-sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.pt-sheet-sortable:hover {
  background: rgba(255, 255, 255, 0.08);
}
.pt-sheet-sort-icon {
  margin-left: 4px;
  opacity: 0.6;
}

/* Gantt Studio */
.pt-ai-gantt-studio {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pt-ai-gantt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}
.pt-ai-gantt-title {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}
.pt-ai-gantt-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pt-ai-gantt-actions button {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pt-ai-gantt-actions button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Interactive SVG Gantt */
.pt-ai-gantt-svg-container {
  width: 100%;
  overflow-x: auto;
  padding: 16px 0;
}

.pt-ai-gantt-svg {
  min-width: 600px;
  font-family: inherit;
}

/* Canvas Footer Patch Box */
.pt-ai-canvas-footer {
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pt-ai-canvas-patch-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 14px;
  color: #ffffff;
  font-size: 12px;
  outline: none;
  transition: all 0.2s ease;
}

.pt-ai-canvas-patch-input:focus {
  border-color: #f97316;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.2);
}

.pt-ai-canvas-patch-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
  transition: all 0.2s ease;
}

.pt-ai-canvas-patch-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.45);
}

/* Fullscreen Canvas Mode overrides */
#pt-ai-response-zone.pt-ai-canvas-fullscreen .pt-ai-canvas-footer {
  margin-bottom: 0 !important;
}

#pt-ai-response-zone.pt-ai-canvas-fullscreen #pt-ai-canvas-workspace .pt-ai-canvas-body {
  padding-bottom: 80px !important;
}

/* Mobile responsive rules for Canvas */
@media (max-width: 768px) {

  .pt-ai-canvas-body,
  #pt-ai-canvas-body-content {
    padding: 24px 20px 180px 20px !important;
    font-size: 13.5px !important;
  }

  .pt-ai-canvas-split-container {
    flex-direction: column !important;
  }

  .pt-ai-canvas-chat-pane {
    flex: 0 0 45% !important;
    max-width: 100% !important;
    min-width: 100% !important;
  }

  #pt-ai-canvas-workspace {
    flex: 1 1 55% !important;
    min-width: 100% !important;
  }
}

/* Artifact Card Inside Chat Stream */
.pt-ai-artifact-card {
  margin: 14px 0;
  border-radius: 14px;
  background: rgba(18, 18, 26, 0.7);
  border: 1px solid rgba(249, 115, 22, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 20px rgba(249, 115, 22, 0.03);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pt-ai-artifact-card:hover {
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), 0 0 20px rgba(249, 115, 22, 0.12);
}

.pt-ai-artifact-card-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pt-ai-artifact-card-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pt-ai-artifact-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-ai-btn-open-canvas {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pt-ai-btn-open-canvas:hover {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.4), rgba(99, 102, 241, 0.4));
  border-color: #f97316;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.35);
  transform: translateY(-1px);
}

.pt-ai-artifact-card-preview {
  padding: 12px 16px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  max-height: 80px;
  overflow: hidden;
  position: relative;
}

.pt-ai-artifact-card-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to bottom, transparent, rgba(18, 18, 26, 0.95));
}

.pt-ai-artifact-card-actions {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ══════════════════════════════════════════════════════════════════════════
   AURA 5.0 — ÉTAPE 3 : PREDICTIVE CHIPS, MORNING DIGEST & SYSTEM 2 THINKING
   ══════════════════════════════════════════════════════════════════════════ */

/* 1. Predictive Next-Best-Action Chips */
.pt-ai-predictive-chips-container {
  /* Hauteur animée de 0 à son contenu (grid 0fr → 1fr) : le dock grandit
     progressivement au lieu de changer de taille d'un coup. */
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  padding: 0 12px;
  transition: grid-template-rows 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease;
}

.pt-ai-predictive-chips-container.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 10px 12px 6px;
  transition-delay: 0s, 0s, 0.12s;
}

.pt-ai-predictive-chips-track {
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pt-ai-predictive-chips-track::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: reduce) {

  .pt-ai-predictive-chips-container,
  .pt-ai-predictive-chips-container.is-open {
    transition: none;
  }
}

.pt-ai-predictive-chips-container[hidden] {
  display: none !important;
}

/* Même dépliage que le bloc de décision (voir .has-decision). */
.pt-ai-dock-outer.has-suggestions {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-radius: 28px 28px 37px 37px;
}

.pt-ai-dock-outer.has-suggestions:hover {
  transform: none;
}

.pt-ai-dock-outer.has-suggestions::after {
  border-radius: 28px 28px 37px 37px;
}

.pt-ai-dock-outer.has-suggestions>.pt-ai-dock {
  /* Même facteur d'étirement que la pilule (flex: 1) : avec 0, la transition
     « all » du dock animait l'étirement et le dock rétrécissait au repli. */
  flex: 1 1 auto;
  margin: 0 4px 4px;
}

.pt-ai-predictive-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.pt-ai-predictive-chip:hover {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.35);
  color: #ffedd5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.12);
}

.pt-ai-predictive-chip.priority-high {
  border-color: rgba(249, 115, 22, 0.25);
}

/* 2. Morning Digest Executive Card */
.pt-ai-morning-digest-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
}

.pt-ai-digest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.pt-ai-digest-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
}

.pt-ai-digest-greeting {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}

.pt-ai-digest-audio-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pt-ai-digest-audio-btn:hover {
  border-color: rgba(var(--primary-rgb, 217, 119, 6), 0.6);
  color: #fff;
}

.pt-ai-digest-section {
  --sec: 148, 163, 184;
  position: relative;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(var(--sec), 0.08);
}

/* Une couleur par rubrique, pour les repérer d'un coup d'œil. */
.pt-ai-digest-section[data-key="tickets"] {
  --sec: 249, 115, 22;
}

.pt-ai-digest-section[data-key="reminders"] {
  --sec: 234, 179, 8;
}

.pt-ai-digest-section[data-key="deadlines"] {
  --sec: 139, 92, 246;
}

.pt-ai-digest-section[data-key="absences"] {
  --sec: 14, 165, 233;
}

.pt-ai-digest-section[data-key="servers"] {
  --sec: 244, 63, 94;
}

.pt-ai-digest-section.is-empty {
  background: rgba(var(--sec), 0.05);
}

.pt-ai-digest-icon {
  width: 13px;
  height: 13px;
  color: rgb(var(--sec));
  flex-shrink: 0;
  align-self: center;
}

.pt-ai-digest-section-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.pt-ai-digest-items a.pt-ai-digest-label {
  text-decoration: none;
}

.pt-ai-digest-items a.pt-ai-digest-label:hover {
  color: rgb(var(--sec));
  text-decoration: underline;
}

.pt-ai-digest-footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.pt-ai-digest-analysis {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease 0.1s;
}

.pt-ai-digest-analysis.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.pt-ai-digest-analysis>p {
  min-height: 0;
  overflow: hidden;
  margin: 0;
  border-radius: 10px;
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.5;
}

.pt-ai-digest-analysis.is-open>p {
  margin: 4px 0 2px;
  padding: 9px 12px;
}

/* Bouton « Arrêter » de la lecture audio, dans le dock */
.pt-ai-audio-stop {
  /* Bouton rond compact, à la taille des autres icônes du dock : l'onde dit
     « lecture en cours », le carré apparaît au survol pour dire « arrêter ». */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  margin-right: 6px;
  border-radius: 50%;
  border: none;
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.14);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.pt-ai-audio-stop-square {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--primary, #d97706);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pt-ai-audio-stop:hover .pt-ai-audio-stop-square {
  opacity: 1;
  transform: none;
}

.pt-ai-audio-stop:hover .pt-ai-audio-stop-wave {
  opacity: 0;
}

.pt-ai-audio-stop.is-visible {
  opacity: 1;
  transform: none;
}

.pt-ai-audio-stop:hover {
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.25);
}

.pt-ai-audio-stop-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 14px;
  transition: opacity 0.15s ease;
}

.pt-ai-audio-stop-wave i {
  width: 2px;
  height: 100%;
  border-radius: 1px;
  background: var(--primary, #d97706);
  animation: pt-ai-audio-wave 0.9s ease-in-out infinite;
}

.pt-ai-audio-stop-wave i:nth-child(2) {
  animation-delay: 0.15s;
}

.pt-ai-audio-stop-wave i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pt-ai-audio-wave {

  0%,
  100% {
    transform: scaleY(0.35);
  }

  50% {
    transform: scaleY(1);
  }
}

.pt-ai-digest-audio-btn.is-ready {
  border-color: rgba(var(--primary-rgb, 217, 119, 6), 0.7);
  color: #fff;
  animation: pt-ai-digest-pulse 1.4s ease-in-out infinite;
}

.pt-ai-digest-thinking {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  animation: pt-ai-digest-pulse 1.4s ease-in-out infinite;
}

@keyframes pt-ai-digest-pulse {
  50% {
    opacity: 0.4;
  }
}

/* Suggestions de suite, sous la dernière réponse */
.pt-ai-followups {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin: 0;
  transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease 0.08s, margin 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pt-ai-followups.is-visible {
  grid-template-rows: 1fr;
  opacity: 1;
  margin: 8px 0 4px;
}

.pt-ai-followups-track {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (prefers-reduced-motion: reduce) {

  .pt-ai-followups,
  .pt-ai-digest-analysis {
    transition: none;
  }
}

.pt-ai-followup {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pt-ai-followup:hover {
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.12);
  border-color: rgba(var(--primary-rgb, 217, 119, 6), 0.45);
  color: #fff;
}

.pt-ai-digest-prioritize {
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.15);
  border: 1px solid rgba(var(--primary-rgb, 217, 119, 6), 0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pt-ai-digest-prioritize:hover {
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.3);
}

.pt-ai-digest-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

.pt-ai-digest-count {
  font-size: 10px;
  font-weight: 700;
  color: rgb(var(--sec));
}

.pt-ai-digest-empty {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.pt-ai-digest-items {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.pt-ai-digest-items li {
  position: relative;
  padding: 2px 0 2px 12px;
}

.pt-ai-digest-items li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.pt-ai-digest-items li::before {
  background: rgba(var(--sec), 0.6);
}

.pt-ai-digest-items li.is-alert::before {
  background: #f43f5e;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.25);
}

.pt-ai-digest-label {
  color: #f1f5f9;
  overflow-wrap: anywhere;
}

.pt-ai-digest-meta {
  display: block;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
}

/* 3. System 2 Thinking & Agentic Debate Accordion */
.pt-ai-thinking-accordion {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 10px;
  margin: 12px 0;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.6;
}

.pt-ai-thinking-accordion summary {
  cursor: pointer;
  font-weight: 600;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 6px;
  outline: none;
  user-select: none;
}

.pt-ai-thinking-accordion summary:hover {
  color: #ddd6fe;
}

.pt-ai-thinking-accordion[open] summary {
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  padding-bottom: 6px;
}

/* 4. Atomic Rollback Toast & Trigger */
.pt-ai-rollback-banner {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
}

.pt-ai-rollback-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pt-ai-rollback-btn:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #ffffff;
}

/* ==========================================================================
   Liste des conversations Aura : cartes compactes groupées par période
   (surcharge les anciens styles .pt-ai-session-* : desktop et mobile)
   ========================================================================== */
#pt-ai-sessions-list {
  padding: 0.75rem !important;
}

#pt-ai-sessions-list>*+* {
  margin-top: 0.5rem !important;
}

#pt-ai-sessions-list .pt-ai-sess-group {
  padding: 0.6rem 0.25rem 0.1rem;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

#pt-ai-sessions-list .pt-ai-sess-group:first-child {
  padding-top: 0;
}

/* Carte */
#pt-ai-sessions-list .pt-ai-session-item.pt-ai-sess {
  position: relative;
  display: flex !important;
  align-items: center !important;
  gap: 0.6rem !important;
  min-height: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  padding: 0.65rem 0.75rem !important;
  border-radius: 0.85rem !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.065) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#pt-ai-sessions-list .pt-ai-session-item.pt-ai-sess:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

#pt-ai-sessions-list .pt-ai-session-item.pt-ai-sess.active {
  background: rgba(var(--pt-brand-rgb, 249, 115, 22), 0.16) !important;
  border-color: rgba(var(--pt-brand-rgb, 249, 115, 22), 0.4) !important;
}


/* Colonne gauche : titre + identifiant et tokens */
#pt-ai-sessions-list .pt-ai-sess-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

#pt-ai-sessions-list .pt-ai-sess-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#pt-ai-sessions-list .pt-ai-sess.active .pt-ai-sess-title {
  color: #fff;
}

#pt-ai-sessions-list .pt-ai-sess-meta {
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 10px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
}

#pt-ai-sessions-list .pt-ai-sess-id {
  flex-shrink: 0;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-500, #f97316);
  background: rgba(var(--pt-brand-rgb, 249, 115, 22), 0.12);
  border: 1px solid rgba(var(--pt-brand-rgb, 249, 115, 22), 0.25);
}

#pt-ai-sessions-list .pt-ai-sess-tokens {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Colonne droite : heure, nombre de messages dessous, puis suppression */
#pt-ai-sessions-list .pt-ai-sess-side {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

#pt-ai-sessions-list .pt-ai-sess-when {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

#pt-ai-sessions-list .pt-ai-sess-time {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.55);
}

#pt-ai-sessions-list .pt-ai-sess-count {
  font-size: 9.5px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.35);
}

#pt-ai-sessions-list .pt-ai-sess .pt-ai-session-delete {
  position: static !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0.5rem !important;
  border: none !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.35) !important;
  opacity: 1 !important;
  transform: none !important;
}

#pt-ai-sessions-list .pt-ai-sess .pt-ai-session-delete:hover {
  color: #f87171 !important;
  background: rgba(248, 113, 113, 0.12) !important;
}

/* Souris : la suppression n'apparaît qu'au survol */
@media (hover: hover) {
  #pt-ai-sessions-list .pt-ai-sess .pt-ai-session-delete {
    display: none !important;
  }

  #pt-ai-sessions-list .pt-ai-sess:hover .pt-ai-session-delete {
    display: inline-flex !important;
  }
}

/* Mobile : cartes plus aérées, cibles tactiles confortables */
@media (max-width: 767px) {
  #pt-ai-sessions-list {
    padding: 0.6rem 0.6rem 1rem !important;
  }

  #pt-ai-sessions-list>*+* {
    margin-top: 0.45rem !important;
  }

  #pt-ai-sessions-list .pt-ai-session-item.pt-ai-sess {
    padding: 0.7rem 0.5rem 0.7rem 0.8rem !important;
    gap: 0.5rem !important;
  }

  #pt-ai-sessions-list .pt-ai-sess-title {
    font-size: 13px;
  }

  #pt-ai-sessions-list .pt-ai-sess .pt-ai-session-delete {
    width: 32px !important;
    height: 32px !important;
  }
}

/* Conversation qui tourne en arrière-plan : point devant le titre */
#pt-ai-sessions-list .pt-ai-session-item.pt-ai-sess.background-active::after {
  right: auto !important;
  left: 4px !important;
  top: 50% !important;
  width: 5px !important;
  height: 5px !important;
}

/* ==========================================================================
   Carte de livrable (Canvas) : mise en page qui s'adapte à la largeur,
   aperçu de code lisible, boutons sur une ligne
   ========================================================================== */
.pt-ai-artifact-card-header {
  flex-wrap: wrap;
  gap: 8px 10px;
}

.pt-ai-artifact-card-info {
  flex: 1 1 12rem;
}

.pt-ai-artifact-card-info>svg,
.pt-ai-artifact-card-info .pt-ai-canvas-badge {
  flex-shrink: 0;
}

.pt-ai-btn-open-canvas {
  white-space: nowrap;
  flex-shrink: 0;
}

.pt-ai-artifact-card-preview.is-code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  white-space: pre;
  overflow-x: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.7);
}

.pt-ai-artifact-card-actions {
  flex-wrap: wrap;
}

.pt-ai-artifact-card-actions .pt-ai-canvas-action-btn {
  white-space: nowrap;
  flex: 0 0 auto;
}

@media (max-width: 767px) {

  /* Bouton « Ouvrir dans Canvas » sur sa propre ligne, pleine largeur */
  .pt-ai-artifact-card-header {
    padding: 12px 14px;
  }

  .pt-ai-btn-open-canvas {
    flex: 1 1 100%;
    justify-content: center;
    padding: 8px 12px;
  }

  .pt-ai-artifact-card-actions {
    padding: 8px 14px;
  }

  .pt-ai-artifact-card-actions .pt-ai-canvas-action-btn {
    flex: 1 1 0;
    justify-content: center;
  }

  /* Canvas ouvert : il occupe toute la conversation (plus de partage vertical écrasé) */
  #pt-ai-response-zone.pt-ai-canvas-open .pt-ai-canvas-chat-pane {
    display: none !important;
  }

  #pt-ai-response-zone.pt-ai-canvas-open .pt-ai-canvas-split-container {
    flex-direction: column !important;
  }

  #pt-ai-response-zone.pt-ai-canvas-open #pt-ai-canvas-workspace {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #pt-ai-response-zone.pt-ai-canvas-open #pt-ai-canvas-resizer {
    display: none !important;
  }

  #pt-ai-response-zone.pt-ai-canvas-open .pt-ai-canvas-body,
  #pt-ai-response-zone.pt-ai-canvas-open #pt-ai-canvas-body-content {
    padding: 16px 14px 24px !important;
  }

  /* En-tête du Canvas : titre coupé proprement, boutons compacts sur une ligne,
     pas de plein écran (le Canvas occupe déjà toute la conversation) */
  #pt-ai-canvas-workspace .pt-ai-canvas-header {
    gap: 8px;
    padding: 10px 12px !important;
    flex-wrap: nowrap !important;
  }

  #pt-ai-canvas-workspace .pt-ai-canvas-header-left {
    min-width: 0;
    flex: 1 1 auto;
  }

  #pt-ai-canvas-workspace .pt-ai-canvas-title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #pt-ai-canvas-workspace .pt-ai-canvas-actions {
    flex-shrink: 0;
    gap: 4px !important;
  }

  #pt-ai-canvas-fullscreen-btn,
  #pt-ai-canvas-presence {
    display: none !important;
  }

  #pt-ai-canvas-workspace .pt-ai-canvas-footer {
    padding: 8px 10px !important;
    gap: 8px;
  }

  #pt-ai-canvas-patch-prompt {
    min-width: 0;
    font-size: 13px;
  }
}

/* ── Puce du tour : réflexion · complexité · niveau · tokens · humeur ── */

/* Masquer les bulles IA compltement vides */
.pt-ai-message.ai:has(.pt-ai-msg-bubble:empty):not(:has(.pt-ai-artifact-block)):not(:has(.pt-ai-file-pill)):not(:has(.pt-ai-review-note)):not(.pt-ai-streaming) {
  display: none !important;
}

/* ==========================================================================
   En-tête du dock — anciennement un <style> imprimé dans le widget
   (class-ai-assistant-core.php). Imprimé après mobile-nav.php, il annulait
   les réglages mobiles ; il reste en fin de fichier pour garder sa priorité
   sur les règles ci-dessus.
   ========================================================================== */
.pt-ai-response-header {
  display: flex !important;
  flex-direction: column !important;
  margin-bottom: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding-bottom: 0 !important;
  background: rgba(0, 0, 0, 0.45) !important;
}

#pt-ai-response-header-trigger {
  padding: 8px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.pt-ai-response-header h4 {
  color: #ffffff !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.15) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase !important;
  margin: 0 !important;
  line-height: 1 !important;
}

#pt-ai-status-badge {
  width: 6px !important;
  height: 6px !important;
  border-radius: 9999px !important;
  border: none !important;
  box-shadow: 0 0 8px currentColor !important;
}

#pt-ai-response-close {
  width: 24px !important;
  height: 24px !important;
  border-radius: 9999px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.65) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
}

#pt-ai-response-close:hover {
  color: #ff4d4d !important;
  background: rgba(255, 77, 77, 0.15) !important;
  border-color: rgba(255, 77, 77, 0.25) !important;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.1) !important;
}

.pt-ai-main-tabs-nav {
  background: rgba(0, 0, 0, 0.4) !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

#pt-ai-header-quick-stats {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 9999px !important;
  padding: 4px 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.2s ease !important;
}

#pt-ai-header-quick-stats:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Suppression complète des barres de défilement (Scrollbars) */
#pt-ai-main-tab-stats,
#pt-ai-log-list {
  -ms-overflow-style: none !important;
  /* IE and Edge */
  scrollbar-width: none !important;
  /* Firefox */
}

#pt-ai-main-tab-stats::-webkit-scrollbar,
#pt-ai-log-list::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Log List prend toute la hauteur disponible */
#pt-ai-log-list {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
}

/* Stylisation premium des Accordéons de logs */
.pt-ai-request-group {
  flex-shrink: 0 !important;
  margin-bottom: 12px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  background: rgba(15, 15, 20, 0.45) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.pt-ai-request-group:not(.collapsed) {
  border-color: rgba(249, 115, 22, 0.35) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 0 12px rgba(249, 115, 22, 0.04) !important;
  background: rgba(20, 20, 25, 0.65) !important;
}

.pt-ai-request-header {
  display: flex !important;
  flex-direction: column !important;
  padding: 10px 14px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.pt-ai-request-group.collapsed .pt-ai-request-header {
  border-bottom: none !important;
}

.pt-ai-request-header:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.pt-ai-request-toggle {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  opacity: 0.6 !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

.pt-ai-request-header:hover .pt-ai-request-toggle {
  opacity: 1 !important;
  color: #f97316 !important;
}

.pt-ai-request-group.collapsed .pt-ai-request-toggle {
  transform: rotate(-90deg) !important;
}

/* Conteneurs d'accordéons scrollables avec scrollbars ultra-premium */
.pt-ai-request-body {

  overflow-y: auto !important;
}

.pt-ai-accordion-inner {
  max-height: 350px !important;
  overflow-y: auto !important;
}

.accordion-inner-grid {
  max-height: 280px !important;
  overflow-y: auto !important;
}

.pt-ai-usage-accordion-content {
  max-height: 220px !important;
  overflow-y: auto !important;
}

.pt-ai-request-body,
.pt-ai-accordion-inner,
.accordion-inner-grid,
.pt-ai-usage-accordion-content {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(249, 115, 22, 0.2) rgba(255, 255, 255, 0.02) !important;
}

.pt-ai-request-body::-webkit-scrollbar,
.pt-ai-accordion-inner::-webkit-scrollbar,
.accordion-inner-grid::-webkit-scrollbar,
.pt-ai-usage-accordion-content::-webkit-scrollbar {
  width: 5px !important;
  height: 5px !important;
  display: block !important;
}

.pt-ai-request-body::-webkit-scrollbar-track,
.pt-ai-accordion-inner::-webkit-scrollbar-track,
.accordion-inner-grid::-webkit-scrollbar-track,
.pt-ai-usage-accordion-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02) !important;
  border-radius: 4px !important;
}

.pt-ai-request-body::-webkit-scrollbar-thumb,
.pt-ai-accordion-inner::-webkit-scrollbar-thumb,
.accordion-inner-grid::-webkit-scrollbar-thumb,
.pt-ai-usage-accordion-content::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.2) !important;
  border-radius: 4px !important;
}

.pt-ai-request-body::-webkit-scrollbar-thumb:hover,
.pt-ai-accordion-inner::-webkit-scrollbar-thumb:hover,
.accordion-inner-grid::-webkit-scrollbar-thumb:hover,
.pt-ai-usage-accordion-content::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.45) !important;
}

/* Overlay d'arrière-plan flou de l'espace de travail Aura */
.pt-ai-response-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(16px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(120%) !important;
  z-index: 1999998 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1), backdrop-filter 0.5s cubic-bezier(0.19, 1, 0.22, 1) !important;
}

.pt-ai-response-overlay.visible {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Bouton « Options » du dock : affiché uniquement par la barre beta (mobile-nav.php) */
#pt-mnav-ai-options-btn[hidden] {
  display: none;
}

/* ── Mode vocal IA (maintenir « Envoyer » 2 s) ─────────────────────────── */
@property --pt-hold {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.pt-ai-dock-send {
  position: relative;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}

/* Anneau qui se remplit pendant l'appui : le mode vocal démarre quand il est plein */
.pt-ai-dock-send::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--primary, #d97706) var(--pt-hold), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  opacity: 0;
  pointer-events: none;
}

.pt-ai-dock-send.is-holding::before {
  opacity: 1;
  animation: pt-voice-hold 2s linear forwards;
}

@keyframes pt-voice-hold {
  from {
    --pt-hold: 0deg;
  }

  to {
    --pt-hold: 360deg;
  }
}

/* En mode vocal, « Envoyer » devient « Quitter » (carré) */
.pt-ai-voice-mode .pt-ai-dock-send>svg {
  display: none;
}

.pt-ai-voice-mode .pt-ai-dock-send::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: currentColor;
}

.pt-ai-voice-mode .pt-ai-dock-input {
  visibility: hidden;
}

.pt-ai-voice-live {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.75rem;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: inherit;
  --pt-voice-level: 0;
}

.pt-ai-voice-live[hidden] {
  display: none !important;
}

.pt-ai-voice-bars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
}

.pt-ai-voice-bars i {
  width: 3px;
  height: 22px;
  border-radius: 2px;
  background: var(--primary, #d97706);
  transform-origin: center;
  transform: scaleY(calc(0.18 + var(--pt-voice-level) * 0.82));
  transition: transform .08s linear;
}

.pt-ai-voice-bars i:nth-child(2),
.pt-ai-voice-bars i:nth-child(4) {
  transform: scaleY(calc(0.18 + var(--pt-voice-level) * 0.6));
}

.pt-ai-voice-bars i:nth-child(1),
.pt-ai-voice-bars i:nth-child(5) {
  transform: scaleY(calc(0.18 + var(--pt-voice-level) * 0.35));
}

[data-voice-state="thinking"] .pt-ai-voice-bars i,
[data-voice-state="speaking"] .pt-ai-voice-bars i {
  transition: none;
  animation: pt-voice-wave 1s ease-in-out infinite;
}

[data-voice-state="thinking"] .pt-ai-voice-bars i {
  animation-duration: 1.6s;
  opacity: 0.6;
}

.pt-ai-voice-bars i:nth-child(2) {
  animation-delay: -0.8s !important;
}

.pt-ai-voice-bars i:nth-child(3) {
  animation-delay: -0.6s !important;
}

.pt-ai-voice-bars i:nth-child(4) {
  animation-delay: -0.4s !important;
}

.pt-ai-voice-bars i:nth-child(5) {
  animation-delay: -0.2s !important;
}

@keyframes pt-voice-wave {

  0%,
  100% {
    transform: scaleY(0.25);
  }

  50% {
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pt-ai-voice-bars i {
    animation: none !important;
  }
}

.pt-ai-voice-live {
  color: #e2e8f0;
}

html.dark .pt-ai-voice-live {
  color: #0f172a;
}

/* ── Écran vocal circulaire ─────────────────────────────────────────────
   hold : l'anneau se remplit pendant l'appui · starting : micro en cours
   d'activation · listening : l'orbe suit la voix · thinking · speaking · error */
.pt-ai-voice-orb {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(8, 10, 16, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: #f8fafc;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility 0s linear .22s;
  --pt-voice-level: 0;
  --pt-voice-c: var(--primary, #d97706);
}

.pt-ai-voice-orb.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .22s ease, visibility 0s;
}

/* Pendant l'appui, l'écran laisse passer le doigt : le relâchement reste sur « Envoyer » */
.pt-ai-voice-orb[data-state="hold"],
.pt-ai-voice-orb[data-state="hold-cancel"] {
  pointer-events: none;
  background: rgba(8, 10, 16, 0.45);
}

.pt-ai-voice-orb-stage {
  position: relative;
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
}

.pt-ai-voice-orb-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pt-ai-voice-orb-track,
.pt-ai-voice-orb-progress {
  fill: none;
  stroke-width: 4;
}

.pt-ai-voice-orb-track {
  stroke: rgba(255, 255, 255, 0.12);
}

.pt-ai-voice-orb-progress {
  stroke: var(--pt-voice-c);
  stroke-linecap: round;
  stroke-dasharray: 351.86;
  stroke-dashoffset: 0;
  transform-origin: 60px 60px;
  transition: stroke-dashoffset .3s ease;
}

.pt-ai-voice-orb[data-state="hold"] .pt-ai-voice-orb-progress {
  stroke-dashoffset: 351.86;
  animation: pt-voice-orb-fill 1.75s linear forwards;
}

.pt-ai-voice-orb[data-state="hold-cancel"] .pt-ai-voice-orb-progress {
  stroke-dashoffset: 351.86;
}

.pt-ai-voice-orb[data-state="starting"] .pt-ai-voice-orb-progress,
.pt-ai-voice-orb[data-state="thinking"] .pt-ai-voice-orb-progress {
  stroke-dashoffset: 260;
  animation: pt-voice-orb-spin 1.1s linear infinite;
}

@keyframes pt-voice-orb-fill {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes pt-voice-orb-spin {
  to {
    transform: rotate(360deg);
  }
}

.pt-ai-voice-orb-core {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 60%), var(--pt-voice-c);
  box-shadow: 0 0 calc(20px + var(--pt-voice-level) * 60px) rgba(var(--primary-rgb, 217, 119, 6), 0.55);
  transform: scale(calc(0.92 + var(--pt-voice-level) * 0.22));
  transition: transform .08s linear, box-shadow .12s linear, background .2s ease;
}

.pt-ai-voice-orb-core svg {
  width: 40px;
  height: 40px;
}

.pt-ai-voice-orb[data-state="hold"] .pt-ai-voice-orb-core,
.pt-ai-voice-orb[data-state="hold-cancel"] .pt-ai-voice-orb-core {
  transform: scale(0.82);
  opacity: 0.85;
}

.pt-ai-voice-orb[data-state="thinking"] .pt-ai-voice-orb-core,
.pt-ai-voice-orb[data-state="starting"] .pt-ai-voice-orb-core {
  transform: scale(0.88);
  animation: pt-voice-orb-breathe 1.8s ease-in-out infinite;
}

.pt-ai-voice-orb[data-state="speaking"] .pt-ai-voice-orb-core {
  animation: pt-voice-orb-talk 0.9s ease-in-out infinite;
}

/* Ondes autour de l'orbe quand Aura parle */
.pt-ai-voice-orb[data-state="speaking"] .pt-ai-voice-orb-stage::before,
.pt-ai-voice-orb[data-state="speaking"] .pt-ai-voice-orb-stage::after {
  content: '';
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  border: 2px solid var(--pt-voice-c);
  animation: pt-voice-orb-wave 1.8s ease-out infinite;
}

.pt-ai-voice-orb[data-state="speaking"] .pt-ai-voice-orb-stage::after {
  animation-delay: .9s;
}

.pt-ai-voice-orb[data-state="error"] {
  --pt-voice-c: #ef4444;
}

@keyframes pt-voice-orb-breathe {

  0%,
  100% {
    transform: scale(0.86);
  }

  50% {
    transform: scale(0.94);
  }
}

@keyframes pt-voice-orb-talk {

  0%,
  100% {
    transform: scale(0.95);
  }

  50% {
    transform: scale(1.06);
  }
}

@keyframes pt-voice-orb-wave {
  from {
    transform: scale(1);
    opacity: 0.7;
  }

  to {
    transform: scale(1.55);
    opacity: 0;
  }
}

.pt-ai-voice-orb-label {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pt-ai-voice-orb-detail {
  max-width: 34rem;
  min-height: 1.2em;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(248, 250, 252, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pt-ai-voice-orb-close {
  margin-top: 0.5rem;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pt-ai-voice-orb-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.pt-ai-voice-orb[data-state="hold"] .pt-ai-voice-orb-close,
.pt-ai-voice-orb[data-state="hold-cancel"] .pt-ai-voice-orb-close {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {

  .pt-ai-voice-orb *,
  .pt-ai-voice-orb *::before,
  .pt-ai-voice-orb *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Mode vocal : choix « Message vocal » ou « Discussion » */
.pt-ai-voice-orb-modes {
  display: inline-flex;
  padding: 3px;
  margin-top: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.pt-ai-voice-orb-modes button {
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(248, 250, 252, 0.75);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.pt-ai-voice-orb-modes button[aria-checked="true"] {
  background: var(--pt-voice-c);
  color: #fff;
}

.pt-ai-voice-orb-hint {
  max-width: 26rem;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.55);
}

.pt-ai-voice-orb[data-state="hold"] .pt-ai-voice-orb-modes,
.pt-ai-voice-orb[data-state="hold-cancel"] .pt-ai-voice-orb-modes,
.pt-ai-voice-orb[data-state="error"] .pt-ai-voice-orb-modes,
.pt-ai-voice-orb[data-state="hold"] .pt-ai-voice-orb-hint,
.pt-ai-voice-orb[data-state="hold-cancel"] .pt-ai-voice-orb-hint,
.pt-ai-voice-orb[data-state="error"] .pt-ai-voice-orb-hint {
  visibility: hidden;
}

/* Bouton « Écouter / Arrêter » d'une réponse */
.pt-ai-action-listen .pt-ai-listen-play {
  width: 14px;
  height: 14px;
}

.pt-ai-action-listen .pt-ai-listen-stop {
  display: none;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}

.pt-ai-action-listen.is-playing {
  color: var(--primary, #d97706) !important;
  opacity: 1 !important;
}

.pt-ai-action-listen.is-playing .pt-ai-listen-play {
  display: none;
}

.pt-ai-action-listen.is-playing .pt-ai-listen-stop {
  display: block;
}

.pt-ai-action-listen.is-loading {
  opacity: 1 !important;
  animation: pt-voice-orb-breathe 1.2s ease-in-out infinite;
}

/* Champ vide : « Envoyer » devient un micro (message vocal) */
.pt-ai-dock-send .pt-ai-mic-icon,
.pt-ai-dock-send.is-voice .pt-ai-send-icon {
  display: none;
}

.pt-ai-dock-send.is-voice .pt-ai-mic-icon {
  display: block;
}

/* Mode cle API non configuree : forcer l'affichage de l'icone d'envoi et masquer le micro */
.pt-ai-dock-send.is-key-submit .pt-ai-mic-icon,
[data-has-key="0"] .pt-ai-dock-send .pt-ai-mic-icon,
.is-unconfigured-key .pt-ai-dock-send .pt-ai-mic-icon {
  display: none !important;
}

.pt-ai-dock-send.is-key-submit .pt-ai-send-icon,
[data-has-key="0"] .pt-ai-dock-send .pt-ai-send-icon,
.is-unconfigured-key .pt-ai-dock-send .pt-ai-send-icon {
  display: block !important;
}

/* Masquer tous les boutons secondaires, vocal et suggestions predictives quand la cle n'est pas configuree */
html body [data-has-key="0"] #pt-ai-dock-spark,
html body .is-unconfigured-key #pt-ai-dock-spark,
html body [data-has-key="0"] #pt-ai-tools-toggle-btn,
html body .is-unconfigured-key #pt-ai-tools-toggle-btn,
html body [data-has-key="0"] div:has(> #pt-ai-tools-toggle-btn),
html body .is-unconfigured-key div:has(> #pt-ai-tools-toggle-btn),
html body [data-has-key="0"] #pt-ai-upload-btn,
html body .is-unconfigured-key #pt-ai-upload-btn,
html body [data-has-key="0"] #pt-ai-voice-btn,
html body .is-unconfigured-key #pt-ai-voice-btn,
html body [data-has-key="0"] #pt-ai-voice-live,
html body .is-unconfigured-key #pt-ai-voice-live,
html body [data-has-key="0"] #pt-ai-predictive-chips,
html body .is-unconfigured-key #pt-ai-predictive-chips,
html body [data-has-key="0"] .pt-ai-predictive-chips-container,
html body .is-unconfigured-key .pt-ai-predictive-chips-container,
html body [data-has-key="0"] #pt-mnav-ai-options-btn,
html body .is-unconfigured-key #pt-mnav-ai-options-btn {
  display: none !important;
}

/* Espacement equilibre du champ quand le bouton Spark est masque */
.is-unconfigured-key .pt-ai-dock,
[data-has-key="0"] .pt-ai-dock {
  padding-left: 1.15rem !important;
}

/* Message vocal envoyé, en attente de transcription */
.pt-ai-voice-pending .pt-ai-msg-text {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  opacity: 0.85;
}

.pt-ai-voice-pending-icon {
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19v3'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Crect x='9' y='2' width='6' height='13' rx='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19v3'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Crect x='9' y='2' width='6' height='13' rx='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pt-ai-voice-pending .pt-ai-typing-dots {
  display: inline-flex;
}

/* Écran vocal : mode utilisé (Live temps réel ou standard) */
.pt-ai-voice-orb-badge {
  max-width: 30rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(248, 250, 252, 0.7);
}

.pt-ai-voice-orb-badge.is-live {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.pt-ai-voice-orb-badge[hidden],
.pt-ai-voice-orb[data-state="hold"] .pt-ai-voice-orb-badge,
.pt-ai-voice-orb[data-state="hold-cancel"] .pt-ai-voice-orb-badge {
  display: none;
}

/* Écran vocal : fil de l'échange, comme une conversation à deux */
.pt-ai-voice-orb-chat {
  display: none;
  order: -1;
  width: min(36rem, 100%);
  max-height: 42vh;
  overflow-y: auto;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem 0.25rem 0.5rem;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 1.5rem);
  mask-image: linear-gradient(to bottom, transparent 0, #000 1.5rem);
}

.pt-ai-voice-orb-chat::-webkit-scrollbar {
  display: none;
}

.pt-ai-voice-orb.has-chat .pt-ai-voice-orb-chat {
  display: flex;
}

.pt-ai-voice-bubble {
  max-width: 82%;
  padding: 0.6rem 0.9rem;
  border-radius: 1.1rem;
  font-size: 14px;
  line-height: 1.45;
  text-align: start;
  white-space: pre-wrap;
  animation: pt-voice-bubble-in .2s ease-out;
}

.pt-ai-voice-bubble.is-user {
  align-self: flex-end;
  background: var(--pt-voice-c);
  color: #fff;
  border-bottom-right-radius: 0.35rem;
}

.pt-ai-voice-bubble.is-ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border-bottom-left-radius: 0.35rem;
}

@keyframes pt-voice-bubble-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Avec le fil, l'orbe se fait plus discret et le texte en double disparaît */
.pt-ai-voice-orb.has-chat .pt-ai-voice-orb-stage {
  width: 120px;
  height: 120px;
}

.pt-ai-voice-orb.has-chat .pt-ai-voice-orb-core {
  width: 78px;
  height: 78px;
}

.pt-ai-voice-orb.has-chat .pt-ai-voice-orb-core svg {
  width: 28px;
  height: 28px;
}

.pt-ai-voice-orb.has-chat:not([data-state="error"]) .pt-ai-voice-orb-detail,
.pt-ai-voice-orb.has-chat .pt-ai-voice-orb-hint {
  display: none;
}

.pt-ai-voice-orb.has-chat .pt-ai-voice-orb-label {
  font-size: 15px;
}

/* ── Écran vocal en session : une conversation à deux ────────────────────
   En-tête (mode, type d'échange, terminer) · fil de la conversation ·
   barre du bas avec l'orbe compacte et l'état (écoute, réflexion, parole). */
.pt-ai-voice-orb.is-session {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "badge modes close"
    "chat chat chat"
    "stage status status";
  align-items: center;
  gap: 0.9rem 0.9rem;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, calc((100vw - 46rem) / 2)) max(1rem, env(safe-area-inset-bottom));
  text-align: start;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-badge {
  grid-area: badge;
  justify-self: start;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-modes {
  grid-area: modes;
  justify-self: center;
  margin: 0;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-modes button {
  padding: 0.3rem 0.8rem;
  font-size: 12px;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-close {
  grid-area: close;
  margin: 0;
  padding: 0.45rem 1rem;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-chat {
  grid-area: chat;
  display: flex;
  order: 0;
  width: 100%;
  max-height: none;
  height: 100%;
  align-self: stretch;
  padding: 1rem 0.25rem;
}

/* Fil vide : invitation à parler, au centre */
.pt-ai-voice-orb.is-session .pt-ai-voice-orb-chat:empty::before {
  content: 'Parlez, Aura vous écoute et vous répond.';
  margin: auto;
  font-size: 15px;
  color: rgba(248, 250, 252, 0.45);
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-chat> :first-child {
  margin-top: auto;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-bubble {
  font-size: 15px;
  max-width: 78%;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-stage {
  grid-area: stage;
  width: 68px;
  height: 68px;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-core {
  width: 50px;
  height: 50px;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-core svg {
  width: 22px;
  height: 22px;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-ring .pt-ai-voice-orb-track,
.pt-ai-voice-orb.is-session .pt-ai-voice-orb-ring .pt-ai-voice-orb-progress {
  stroke-width: 6;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-stage::before,
.pt-ai-voice-orb.is-session .pt-ai-voice-orb-stage::after {
  inset: 9px !important;
}

/* État à côté de l'orbe, comme dans un appel */
.pt-ai-voice-orb.is-session .pt-ai-voice-orb-label {
  grid-area: status;
  font-size: 15px;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-detail {
  display: none;
}

.pt-ai-voice-orb.is-session[data-state="error"] .pt-ai-voice-orb-detail {
  display: block;
  grid-area: chat;
  align-self: end;
}

.pt-ai-voice-orb.is-session .pt-ai-voice-orb-hint {
  display: none;
}

@media (max-width: 560px) {
  .pt-ai-voice-orb.is-session {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "badge close"
      "modes modes"
      "chat chat"
      "stage status";
  }

  .pt-ai-voice-orb.is-session .pt-ai-voice-orb-close {
    justify-self: end;
  }

  .pt-ai-voice-orb.is-session .pt-ai-voice-bubble {
    max-width: 88%;
  }
}

/* Session vocale : un seul bouton d'arrêt, « Envoyer » devenu carré (il termine
   la session et coupe la voix). Les arrêts audio et de génération sont masqués. */
.pt-ai-dock-outer.pt-ai-voice-mode #pt-ai-audio-stop,
.pt-ai-dock-outer.pt-ai-voice-mode #pt-ai-chat-stop {
  display: none !important;
}

.pt-ai-dock-outer.pt-ai-voice-mode #pt-ai-chat-send {
  display: flex !important;
}

/* Session vocale : « Envoyer » n'affiche que le carré d'arrêt (le micro du champ
   vide l'emportait sur la règle qui masque les icônes) */
.pt-ai-voice-mode .pt-ai-dock-send .pt-ai-mic-icon,
.pt-ai-voice-mode .pt-ai-dock-send .pt-ai-send-icon {
  display: none !important;
}

/* ── Canvas de validation : accordéons compacts, quatre boutons ronds ──── */
#pt-ai-canvas-body-content .pt-ai-review-item-head {
  gap: 10px;
  padding: 10px 12px !important;
}

#pt-ai-canvas-body-content .pt-ai-review-item-actions {
  gap: 6px !important;
  margin-right: 0 !important;
}

#pt-ai-canvas-body-content .pt-ai-review-btn-indiv,
#pt-ai-canvas-body-content .pt-ai-review-caret {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent !important;
  transition: transform .15s ease, background .15s ease, border-color .15s ease !important;
}

#pt-ai-canvas-body-content .pt-ai-review-btn-indiv.is-retouch {
  background: rgba(var(--pt-brand-rgb, 249, 115, 22), 0.12) !important;
  border-color: rgba(var(--pt-brand-rgb, 249, 115, 22), 0.3) !important;
}

#pt-ai-canvas-body-content .pt-ai-review-btn-indiv.is-reject {
  border-color: rgba(239, 68, 68, 0.35) !important;
}

#pt-ai-canvas-body-content .pt-ai-review-btn-indiv.is-approve {
  border-color: rgba(16, 185, 129, 0.4) !important;
}

#pt-ai-canvas-body-content .pt-ai-review-btn-indiv:hover {
  transform: scale(1.08);
}

#pt-ai-canvas-body-content .pt-ai-review-caret {
  margin-left: 0 !important;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25) !important;
  color: var(--pt-text-muted, #94a3b8);
  font-size: 0;
  transform: none !important;
}

#pt-ai-canvas-body-content .pt-ai-review-caret svg {
  width: 16px;
  height: 16px;
  transition: transform .2s ease;
}

#pt-ai-canvas-body-content .pt-ai-review-item.is-open .pt-ai-review-caret svg {
  transform: rotate(180deg);
}

#pt-ai-canvas-body-content .pt-ai-review-btn-indiv svg {
  width: 16px;
  height: 16px;
}

#pt-ai-canvas-body-content .pt-ai-review-form {
  padding: 4px 12px 12px !important;
  gap: 10px !important;
}

/* Carte d'action dans la discussion : bouton d'annulation rond */
.pt-ai-action-ref .pt-ai-btn-cancel-card {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* ── Mentions @ : gras, couleur primaire, infobulle ─────────────────────── */
.pt-ai-mention-mirror {
  position: absolute;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: pre;
  pointer-events: none;
  color: inherit;
  z-index: 0;
}

.pt-ai-dock-input.has-mentions {
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  caret-color: var(--primary, #d97706);
  position: relative;
  z-index: 1;
  background: transparent !important;
}

.pt-ai-mention-mirror-text {
  display: inline-block;
  white-space: pre;
  color: #f1f5f9;
}

html.dark .pt-ai-mention-mirror-text {
  color: #0f172a;
}

.pt-ai-mention-tag {
  font-weight: 700;
  color: var(--primary, #d97706);
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.14);
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 217, 119, 6), 0.14);
}

.pt-ai-message .pt-ai-mention-tag {
  cursor: help;
  padding: 0 2px;
}

/* Bulle de l'utilisateur déjà orange : mention en blanc souligné */
.pt-ai-message.user .pt-ai-mention-tag {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.pt-ai-mention-tip {
  position: fixed;
  z-index: 2147483001;
  max-width: 260px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.5);
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}

.pt-ai-mention-tip.is-visible {
  opacity: 1;
  transform: none;
}

.pt-ai-mention-tip-kind {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary, #d97706);
}

.pt-ai-mention-tip-name {
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.pt-ai-mention-tip-line {
  color: #94a3b8;
}

html.dark .pt-ai-mention-tip {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 23, 42, 0.1);
  color: #334155;
}

html.dark .pt-ai-mention-tip-name {
  color: #0f172a;
}

html.dark .pt-ai-mention-tip-line {
  color: #64748b;
}

/* Plan d'action dans le dock : le dock est en contraste inverse du thème
   (sombre en thème clair, clair en thème sombre). Les couleurs du plan suivent
   le dock, pas la page : sinon tâches et phases disparaissent. Seul le plan
   posé dans le dock est concerné : la fenêtre du plan en cours a son propre fond. */
html:not(.dark) #pt-ai-dock-outer .pt-ai-decision-plan .pt-ai-plan-phase-name {
  color: var(--primary, var(--brand-500, #ea580c)) !important;
  font-weight: 800 !important;
}

html:not(.dark) #pt-ai-dock-outer .pt-ai-decision-plan .pt-ai-plan-task,
html:not(.dark) #pt-ai-dock-outer .pt-ai-decision-plan .pt-ai-plan-label {
  color: rgba(255, 255, 255, 0.88) !important;
}

html:not(.dark) #pt-ai-dock-outer .pt-ai-decision-plan .pt-ai-plan-dot {
  background: rgba(255, 255, 255, 0.3) !important;
}

html.dark #pt-ai-dock-outer .pt-ai-decision-plan .pt-ai-plan-phase-name {
  color: var(--primary, var(--brand-500, #ea580c)) !important;
  font-weight: 800 !important;
}

html.dark #pt-ai-dock-outer .pt-ai-decision-plan .pt-ai-plan-task,
html.dark #pt-ai-dock-outer .pt-ai-decision-plan .pt-ai-plan-label {
  color: #1e293b !important;
}

html.dark #pt-ai-dock-outer .pt-ai-decision-plan .pt-ai-plan-dot {
  background: rgba(15, 23, 42, 0.28) !important;
}

#pt-ai-dock-outer .pt-ai-plan-task[data-status="completed"] .pt-ai-plan-dot {
  background: #22c55e !important;
}

#pt-ai-dock-outer .pt-ai-plan-task[data-status="running"] .pt-ai-plan-dot {
  background: #f97316 !important;
}

#pt-ai-dock-outer .pt-ai-plan-task[data-status="error"] .pt-ai-plan-dot {
  background: #ef4444 !important;
}

#pt-ai-dock-outer .pt-ai-plan-task[data-status="completed"] .pt-ai-plan-label {
  opacity: 0.55;
  text-decoration: line-through;
}

/* Canvas : action déjà traitée, grisée et verrouillée */
/* Grisé, sauf le badge : vert pour validé, rouge pour refusé ou expiré */
#pt-ai-canvas-body-content .pt-ai-review-item.is-settled .pt-ai-review-icon,
#pt-ai-canvas-body-content .pt-ai-review-item.is-settled .pt-ai-review-meta,
#pt-ai-canvas-body-content .pt-ai-review-item.is-settled .pt-ai-review-form {
  opacity: 0.55;
  filter: grayscale(0.6);
}

#pt-ai-canvas-body-content .pt-ai-review-item.is-settled[data-state="done"] {
  border-color: rgba(16, 185, 129, 0.28) !important;
}

#pt-ai-canvas-body-content .pt-ai-review-item.is-settled[data-state="refused"],
#pt-ai-canvas-body-content .pt-ai-review-item.is-settled[data-state="failed"] {
  border-color: rgba(239, 68, 68, 0.22) !important;
}

#pt-ai-canvas-body-content .pt-ai-review-item.is-settled .pt-ai-review-form {
  pointer-events: none;
}

.pt-ai-review-settled-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.pt-ai-review-item[data-state="done"] .pt-ai-review-settled-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.pt-ai-review-item[data-state="refused"] .pt-ai-review-settled-badge,
.pt-ai-review-item[data-state="failed"] .pt-ai-review-settled-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Fil : issue d'une action validée une par une */
.pt-ai-action-result {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  padding: 7px 12px;
  max-width: 92%;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.4;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
  color: inherit;
}

.pt-ai-action-result[data-state="refused"],
.pt-ai-action-result[data-state="failed"] {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.pt-ai-action-result-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
}

.pt-ai-action-result[data-state="refused"] .pt-ai-action-result-icon,
.pt-ai-action-result[data-state="failed"] .pt-ai-action-result-icon {
  background: #ef4444;
}

.pt-ai-action-result-icon svg {
  width: 12px;
  height: 12px;
}

.pt-ai-action-result-text {
  flex: 1;
  min-width: 0;
}

.pt-ai-action-result-link {
  font-weight: 700;
  color: #10b981;
  text-decoration: none;
}

.pt-ai-action-result-id {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  opacity: 0.6;
}

/* Carte d'un lot partiellement traité : neutre (ni verte ni rouge) */
.pt-ai-artifact-card.is-compact.pt-ai-action-ref[data-status="partial"] .pt-ai-btn-open-canvas {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.35);
  color: #94a3b8;
}

/* Fenêtre du plan en cours : toujours sombre (#12121a), quel que soit le thème.
   La règle du thème clair (tâches en ardoise foncée) la rendait illisible. */
html #pt-ai-plan-popover .pt-ai-plan-task,
html #pt-ai-plan-popover .pt-ai-plan-label {
  color: rgba(255, 255, 255, 0.85) !important;
}

html #pt-ai-plan-popover .pt-ai-plan-task[data-status="completed"] .pt-ai-plan-label {
  color: rgba(255, 255, 255, 0.45) !important;
}

html #pt-ai-plan-popover .pt-ai-plan-dot {
  background: rgba(255, 255, 255, 0.25) !important;
}

html #pt-ai-plan-popover .pt-ai-plan-task[data-status="completed"] .pt-ai-plan-dot {
  background: #22c55e !important;
}

html #pt-ai-plan-popover .pt-ai-plan-task[data-status="running"] .pt-ai-plan-dot {
  background: #f97316 !important;
}

html #pt-ai-plan-popover .pt-ai-plan-task[data-status="error"] .pt-ai-plan-dot {
  background: #ef4444 !important;
}

/* Thème sombre : le dock est clair, la pastille du plan et le bouton d'arrêt
   reprennent des couleurs lisibles sur fond clair (texte et piste blancs avant). */
html.dark #pt-ai-dock-outer .pt-ai-plan-pill {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.35);
}

html.dark #pt-ai-dock-outer .pt-ai-plan-pill-track {
  stroke: rgba(15, 23, 42, 0.12);
}

html.dark #pt-ai-dock-outer .pt-ai-plan-pill-count {
  color: #0f172a;
}

html.dark #pt-ai-dock-outer .pt-ai-dock-stop {
  background: rgba(244, 63, 94, 0.08) !important;
  border-color: rgba(244, 63, 94, 0.25) !important;
}

/* Arc du chargement : centré sur le bouton (il débordait d'un côté) */
#pt-ai-dock-outer .pt-ai-dock-stop .pt-ai-loader-circle {
  inset: -2px !important;
  box-sizing: border-box;
}

/* Carte d'avancement d'un document dans la discussion */
.pt-ai-doc-card {
  position: relative;
  flex-shrink: 0;
  margin: 8px 0;
  padding-right: 10px;
  overflow: visible;
  cursor: pointer;
}

.pt-ai-doc-card .pt-ai-artifact-card-main {
  flex: 1;
  min-width: 0;
}

.pt-ai-doc-card-state {
  margin-left: 6px;
  font-weight: 600;
}

.pt-ai-doc-card-bar {
  display: block;
  height: 3px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.pt-ai-doc-card-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--primary, #d97706);
  transition: width .4s ease;
}

.pt-ai-doc-card[data-status="published"] .pt-ai-doc-card-bar i {
  background: #10b981;
}

.pt-ai-doc-card[data-status="gaps"] .pt-ai-doc-card-bar i {
  background: #ef4444;
}

.pt-ai-doc-card[data-status="verifying"] .pt-ai-doc-card-bar i,
.pt-ai-doc-card[data-status="fixing"] .pt-ai-doc-card-bar i {
  animation: pt-voice-orb-breathe 1.4s ease-in-out infinite;
}

.pt-ai-doc-card-open {
  margin-left: auto;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(var(--primary-rgb, 217, 119, 6), 0.4);
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.12);
  color: var(--primary, #d97706);
  white-space: nowrap;
}

.pt-ai-doc-card[data-status="published"] .pt-ai-doc-card-open {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

/* Canvas · document de travail : couverture des sources (marge colorée, source
   au survol), score de l'audit, bandeau de vérification, page d'analyse */
#pt-ai-canvas-body-content .pt-cov {
  border-left: 3px solid transparent;
  padding-left: 12px;
  margin-left: -15px;
  transition: background .15s ease;
}

#pt-ai-canvas-body-content .pt-cov--source {
  border-left-color: rgba(16, 185, 129, 0.7);
}

#pt-ai-canvas-body-content .pt-cov--partiel {
  border-left-color: rgba(245, 158, 11, 0.75);
}

#pt-ai-canvas-body-content .pt-cov--inconnu {
  border-left-color: rgba(239, 68, 68, 0.75);
}

#pt-ai-canvas-body-content .pt-cov:hover {
  background: rgba(148, 163, 184, 0.06);
  cursor: help;
}

#pt-ai-canvas-body-content .pt-score--low>h2::after,
#pt-ai-canvas-body-content .pt-score--mid>h2::after {
  content: 'À renforcer';
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
}

#pt-ai-canvas-body-content .pt-score--mid>h2::after {
  content: 'Correct';
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

#pt-ai-canvas-body-content .pt-doc-audit {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}

#pt-ai-canvas-body-content .pt-doc-audit--ok {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.07);
}

#pt-ai-canvas-body-content .pt-doc-audit table,
#pt-ai-canvas-body-content .pt-doc-analysis table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}

#pt-ai-canvas-body-content .pt-doc-audit th,
#pt-ai-canvas-body-content .pt-doc-audit td,
#pt-ai-canvas-body-content .pt-doc-analysis th,
#pt-ai-canvas-body-content .pt-doc-analysis td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  text-align: left;
  vertical-align: top;
}

/* Barre de défilement du bloc de décision (plan à valider) : fine mais visible,
   selon le fond du dock (clair en thème sombre, sombre en thème clair) */
.pt-ai-decision-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  padding-right: 4px;
}

.pt-ai-decision-body::-webkit-scrollbar {
  width: 5px;
}

.pt-ai-decision-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

html.dark .pt-ai-decision-body {
  scrollbar-color: rgba(15, 23, 42, 0.3) transparent;
}

html.dark .pt-ai-decision-body::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.3);
}
/* Bulle d'étape : le travail continue automatiquement */
.pt-ai-message.pt-ai-step-note .pt-ai-response-content {
  font-size: 13px;
  font-style: italic;
  opacity: 0.7;
}

/* Questions : section concernée en pastille */
.pt-ai-q-chip {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: 1px;
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.14);
  border: 1px solid rgba(var(--primary-rgb, 217, 119, 6), 0.35);
  color: var(--primary, #d97706);
}

/* Canvas · document à modèle : rendu sur feuille claire, comme dans le Report
   Studio (le modèle est dessiné pour une page blanche, illisible sur fond sombre) */
.pt-ai-canvas-body .pt-doc {
  background: #ffffff;
  color: var(--pt-doc-ink);
  border-radius: 12px;
  padding: 32px 36px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.pt-ai-canvas-body .pt-doc h1,
.pt-ai-canvas-body .pt-doc h2,
.pt-ai-canvas-body .pt-doc h3,
.pt-ai-canvas-body .pt-doc h4 {
  color: var(--pt-doc-ink) !important;
  border-bottom-color: var(--pt-doc-line) !important;
}

.pt-ai-canvas-body .pt-doc p,
.pt-ai-canvas-body .pt-doc li,
.pt-ai-canvas-body .pt-doc td {
  color: var(--pt-doc-ink);
}

.pt-ai-canvas-body .pt-doc .pt-ai-table-wrapper {
  background: transparent !important;
  border-color: var(--pt-doc-line) !important;
}

@media (max-width: 640px) {
  .pt-ai-canvas-body .pt-doc {
    padding: 20px 16px;
  }
}

/* Activité en direct dans la bulle d'Aura : ce que le système fait en ce moment */
.pt-ai-live-activity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.08);
  border: 1px solid rgba(var(--primary-rgb, 217, 119, 6), 0.25);
}

.pt-ai-live-activity-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pt-ai-live-activity-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary, #d97706);
  animation: pt-voice-orb-breathe 1.4s ease-in-out infinite;
}

html:not(.dark) .pt-ai-live-activity {
  color: rgba(15, 23, 42, 0.75);
}

.pt-ai-doc-card[data-status="audit"] .pt-ai-doc-card-bar i {
  background: #f59e0b;
}

#pt-ai-canvas-body-content .pt-doc-analysis h3,
#pt-ai-canvas-body-content > h3 {
  margin-top: 22px !important;
}

/* Fiche « Ce que j'ai compris » dans la carte de validation d'un document */
.pt-ai-understanding {
  margin: 0 0 14px;
  padding: 12px 14px 4px;
  border-radius: 12px;
  border: 1px solid rgba(var(--primary-rgb, 217, 119, 6), 0.35);
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.06);
}

.pt-ai-understanding-title {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary, #d97706);
}

/* Revérifier : visible une fois le document rédigé (publié, écarts, audit) */
.pt-ai-doc-card-recheck {
  display: none;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: inherit;
  opacity: 0.85;
}

.pt-ai-doc-card-recheck:hover {
  opacity: 1;
  border-color: rgba(var(--primary-rgb, 217, 119, 6), 0.55);
}

.pt-ai-doc-card[data-status="published"] .pt-ai-doc-card-recheck,
.pt-ai-doc-card[data-status="gaps"] .pt-ai-doc-card-recheck,
.pt-ai-doc-card[data-status="audit"] .pt-ai-doc-card-recheck {
  display: inline-flex;
  margin-left: auto;
}

.pt-ai-doc-card[data-status="published"] .pt-ai-doc-card-recheck + .pt-ai-doc-card-open,
.pt-ai-doc-card[data-status="gaps"] .pt-ai-doc-card-recheck + .pt-ai-doc-card-open,
.pt-ai-doc-card[data-status="audit"] .pt-ai-doc-card-recheck + .pt-ai-doc-card-open {
  margin-left: 6px;
}

/* Source citée d'une section : lien vers le fichier (et la page) */
.pt-ai-canvas-body .pt-doc .pt-cov-src {
  float: right;
  margin: 4px 0 0 12px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  color: #047857;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pt-ai-canvas-body .pt-doc .pt-cov-src:hover {
  background: rgba(16, 185, 129, 0.18);
}

/* ── Phase 5 · Questions : réponses proposées, « Je ne sais pas », « Passer » ── */
.pt-ai-q-count {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary, #d97706);
}

.pt-ai-q-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 12px;
}

.pt-ai-q-opt {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(var(--primary-rgb, 217, 119, 6), 0.4);
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.08);
  color: inherit;
}

.pt-ai-q-opt:hover {
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.18);
}

.pt-ai-q-opt.is-meta {
  border-color: rgba(148, 163, 184, 0.4);
  background: transparent;
  opacity: 0.8;
}

.pt-ai-q-block[data-answer="passée"] textarea,
.pt-ai-q-block[data-answer="je ne sais pas"] textarea {
  opacity: 0.55;
  font-style: italic;
}

/* ── Plan d'un document : bascule de profondeur ── */
.pt-ai-plan-depth {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

.pt-ai-plan-depth-switch {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(var(--primary-rgb, 217, 119, 6), 0.45);
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.1);
  color: var(--primary, #d97706);
}

/* ── Carte du document : pause, reprise, annulation ── */
.pt-ai-doc-card-ctrl {
  display: none;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.pt-ai-doc-card-ctrl button {
  display: none;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.pt-ai-doc-card[data-status="writing"] .pt-ai-doc-card-ctrl,
.pt-ai-doc-card[data-status="template"] .pt-ai-doc-card-ctrl,
.pt-ai-doc-card[data-status="fixing"] .pt-ai-doc-card-ctrl,
.pt-ai-doc-card[data-status="paused"] .pt-ai-doc-card-ctrl {
  display: inline-flex;
}

.pt-ai-doc-card[data-status="writing"] [data-doc-ctrl="pause"],
.pt-ai-doc-card[data-status="template"] [data-doc-ctrl="pause"],
.pt-ai-doc-card[data-status="fixing"] [data-doc-ctrl="pause"],
.pt-ai-doc-card[data-status="paused"] [data-doc-ctrl="resume"],
.pt-ai-doc-card[data-status="writing"] [data-doc-ctrl="cancel"],
.pt-ai-doc-card[data-status="template"] [data-doc-ctrl="cancel"],
.pt-ai-doc-card[data-status="fixing"] [data-doc-ctrl="cancel"],
.pt-ai-doc-card[data-status="paused"] [data-doc-ctrl="cancel"] {
  display: inline-flex;
}

.pt-ai-doc-card-ctrl + .pt-ai-doc-card-recheck + .pt-ai-doc-card-open {
  margin-left: 6px;
}

.pt-ai-doc-card[data-status="cancelled"] {
  opacity: 0.55;
}

/* ── Poste de pilotage du canvas ── */
#pt-ai-canvas-body-content .pt-ai-cockpit {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 15, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.pt-ai-cockpit-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
}

.pt-ai-cockpit-steps i {
  font-style: normal;
  opacity: 0.35;
}

.pt-ai-cockpit-steps .is-done {
  color: #10b981;
}

.pt-ai-cockpit-steps .is-current {
  color: var(--primary, #d97706);
}

.pt-ai-cockpit-steps .is-todo {
  opacity: 0.45;
}

.pt-ai-cockpit-sections {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.pt-ai-cockpit-sec {
  flex-shrink: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.pt-ai-cockpit-sec.is-filled {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
}

.pt-ai-cockpit-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
}

.pt-ai-cockpit-diff {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.pt-diff-on .pt-ai-cockpit-diff {
  border-color: #f59e0b;
  color: #f59e0b;
}

/* ── Sections du document : actions, écriture en direct, changements ── */
.pt-ai-canvas-body .pt-doc [data-pt-section] {
  position: relative;
  transition: box-shadow .3s ease, background .3s ease;
}

.pt-ai-canvas-body .pt-doc .pt-sec-tools {
  position: absolute;
  top: 4px;
  right: 0;
  display: none;
  gap: 4px;
  z-index: 2;
}

.pt-ai-canvas-body .pt-doc [data-pt-section]:hover > .pt-sec-tools {
  display: flex;
}

.pt-ai-canvas-body .pt-doc .pt-sec-tools button {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.pt-ai-canvas-body .pt-doc .pt-sec-tools button:hover {
  color: var(--primary, #d97706);
  border-color: var(--primary, #d97706);
}

.pt-ai-canvas-body .pt-doc .pt-sec-writing {
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 217, 119, 6), 0.55);
  border-radius: 6px;
  animation: pt-voice-orb-breathe 1.4s ease-in-out infinite;
}

.pt-ai-canvas-body .pt-doc .pt-sec-written {
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.45);
  border-radius: 6px;
}

.pt-ai-canvas-body .pt-doc .pt-sec-changed {
  background: rgba(245, 158, 11, 0.08);
  box-shadow: -4px 0 0 #f59e0b;
}

.pt-ai-canvas-body .pt-doc .pt-sec-new {
  background: rgba(16, 185, 129, 0.08);
  box-shadow: -4px 0 0 #10b981;
}

html:not(.dark) #pt-ai-canvas-body-content .pt-ai-cockpit {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .pt-ai-cockpit-sec {
  color: rgba(15, 23, 42, 0.6);
}

/* ── Phase 6 · Relecture client depuis la carte du document ── */
.pt-ai-doc-card-review {
  display: none;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.pt-ai-doc-card-review button {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.pt-ai-doc-card[data-status="published"] .pt-ai-doc-card-review,
.pt-ai-doc-card[data-status="gaps"] .pt-ai-doc-card-review {
  display: inline-flex;
}

.pt-ai-doc-card-review .pt-ai-doc-card-comments {
  display: none;
  border-color: rgba(var(--primary-rgb, 217, 119, 6), 0.5);
  color: var(--primary, #d97706);
}

.pt-ai-doc-card[data-comments]:not([data-comments="0"]) .pt-ai-doc-card-comments {
  display: inline-flex;
}

.pt-ai-doc-card[data-status="published"] .pt-ai-doc-card-review + .pt-ai-doc-card-recheck,
.pt-ai-doc-card[data-status="gaps"] .pt-ai-doc-card-review + .pt-ai-doc-card-recheck {
  margin-left: 6px;
}

/* ── Phase 7 · Dossier de génération dans le canvas ── */
#pt-ai-canvas-body-content .pt-dossier-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 12px;
}

#pt-ai-canvas-body-content .pt-dossier-head span {
  font-size: 12px;
  opacity: 0.6;
}

#pt-ai-canvas-body-content .pt-dossier-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 0 10px;
  scrollbar-width: thin;
  background: inherit;
}

#pt-ai-canvas-body-content .pt-dossier-tab,
#pt-ai-canvas-body-content .pt-dossier-ver,
#pt-ai-canvas-body-content .pt-dossier-open,
.pt-ai-doc-card-dossier,
#pt-ai-canvas-body-content .pt-ai-cockpit-dossier {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

#pt-ai-canvas-body-content .pt-dossier-tab em {
  font-style: normal;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.15);
  color: var(--primary, #d97706);
}

#pt-ai-canvas-body-content .pt-dossier-tab.is-empty {
  opacity: 0.45;
}

#pt-ai-canvas-body-content .pt-dossier-tab.is-active,
#pt-ai-canvas-body-content .pt-dossier-ver.is-active {
  border-color: var(--primary, #d97706);
  color: var(--primary, #d97706);
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.08);
}

#pt-ai-canvas-body-content .pt-dossier-panel {
  display: none;
}

#pt-ai-canvas-body-content .pt-dossier-panel.is-active {
  display: block;
}

#pt-ai-canvas-body-content .pt-dossier-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

#pt-ai-canvas-body-content .pt-dossier-ver small {
  opacity: 0.6;
  font-weight: 400;
  margin-left: 4px;
}

#pt-ai-canvas-body-content .pt-dossier-open {
  margin-left: auto;
}

#pt-ai-canvas-body-content .pt-dossier-viewer {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: opacity .2s ease;
}

#pt-ai-canvas-body-content .pt-dossier-viewer.is-loading {
  opacity: 0.4;
}

#pt-ai-canvas-body-content .pt-dossier-none {
  opacity: 0.6;
  font-style: italic;
}

.pt-ai-doc-card-dossier {
  margin-left: 6px;
  padding: 5px 10px;
  font-size: 11px;
}

#pt-ai-canvas-body-content .pt-dossier-viewer .pt-doc {
  background: #fff;
  color: var(--pt-doc-ink, #18181b);
  border-radius: 10px;
  padding: 24px;
}

/* Carte du document : actions sur une seconde ligne, le titre garde la place */
.pt-ai-artifact-card.is-compact.pt-ai-doc-card {
  flex-wrap: wrap;
  row-gap: 6px;
  border-radius: 20px;
  padding: 8px 10px 8px 8px;
}

.pt-ai-doc-card .pt-ai-doc-card-open {
  margin-left: auto;
}

.pt-ai-doc-card-actions {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-left: 40px;
}

.pt-ai-doc-card-actions .pt-ai-doc-card-ctrl,
.pt-ai-doc-card-actions .pt-ai-doc-card-review,
.pt-ai-doc-card-actions .pt-ai-doc-card-recheck,
.pt-ai-doc-card-actions .pt-ai-doc-card-dossier {
  margin-left: 0 !important;
}

.pt-ai-doc-card-actions button,
.pt-ai-doc-card-actions .pt-ai-doc-card-recheck {
  padding: 3px 10px;
  font-size: 10.5px;
}

@media (max-width: 480px) {
  .pt-ai-doc-card-actions {
    padding-left: 0;
  }
}

/* Onglets du dossier : barre fixe sous l'en-tête du canvas */
.pt-ai-canvas-subbar {
  flex-shrink: 0;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 10, 15, 0.96);
}

.pt-ai-canvas-subbar .pt-dossier-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pt-ai-canvas-subbar .pt-dossier-tab {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.pt-ai-canvas-subbar .pt-dossier-tab em {
  font-style: normal;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.15);
  color: var(--primary, #d97706);
}

.pt-ai-canvas-subbar .pt-dossier-tab.is-empty {
  opacity: 0.45;
}

.pt-ai-canvas-subbar .pt-dossier-tab.is-active {
  border-color: var(--primary, #d97706);
  color: var(--primary, #d97706);
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.08);
}

html:not(.dark) .pt-ai-canvas-subbar {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

/* Liste des discussions : document en cours (premier plan, arrière-plan, pause) */
.pt-ai-sess-work {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: rgba(var(--primary-rgb, 217, 119, 6), 0.08);
  border: 1px solid rgba(var(--primary-rgb, 217, 119, 6), 0.25);
}

.pt-ai-sess-work-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary, #d97706);
}

.pt-ai-sess-work.is-live .pt-ai-sess-work-dot,
.pt-ai-sess-work.is-bg .pt-ai-sess-work-dot {
  animation: pt-voice-orb-breathe 1.4s ease-in-out infinite;
}

.pt-ai-sess-work.is-bg .pt-ai-sess-work-dot {
  background: #3b82f6;
}

.pt-ai-sess-work.is-paused {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.3);
}

.pt-ai-sess-work.is-paused .pt-ai-sess-work-dot {
  background: #94a3b8;
}

.pt-ai-sess-work-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pt-ai-sess-work-ctrl {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}

.pt-ai-sess-work-ctrl button {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.pt-ai-sess-work-ctrl button:hover {
  border-color: var(--primary, #d97706);
  color: var(--primary, #d97706);
}

/* Carte de discussion sur trois lignes : titre (+ suppression), date et repères, état des travaux */
#pt-ai-sessions-list .pt-ai-session-item.pt-ai-sess {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
}

#pt-ai-sessions-list .pt-ai-sess-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#pt-ai-sessions-list .pt-ai-sess-row-title .pt-ai-sess-title {
  flex: 1;
  min-width: 0;
}

#pt-ai-sessions-list .pt-ai-sess-row-meta {
  flex-wrap: wrap;
  justify-content: space-between;
}

#pt-ai-sessions-list .pt-ai-sess-row-meta .pt-ai-sess-meta > span + span::before {
  content: '·';
  margin-right: 0.4rem;
  opacity: 0.6;
}

#pt-ai-sessions-list .pt-ai-sess-row-meta .pt-ai-sess-time,
#pt-ai-sessions-list .pt-ai-sess-row-meta .pt-ai-sess-count {
  font-size: 10px;
  font-weight: 500;
}

#pt-ai-sessions-list .pt-ai-sess .pt-ai-sess-work {
  margin-top: 0;
}

/* La suppression est toujours visible (plus seulement au survol) */
@media (hover: hover) {
  #pt-ai-sessions-list .pt-ai-sess .pt-ai-session-delete {
    display: inline-flex !important;
    flex-shrink: 0;
    width: 24px !important;
    height: 24px !important;
  }
}

/* Ligne 2 de la carte de discussion : repère et tokens à gauche, heure et messages à droite */
#pt-ai-sessions-list .pt-ai-sess-row-meta .pt-ai-sess-meta-right {
  margin-left: auto;
  flex-shrink: 0;
}

#pt-ai-sessions-list .pt-ai-sess-ref {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.45);
}

html:not(.dark) #pt-ai-sessions-list .pt-ai-sess-ref {
  color: rgba(15, 23, 42, 0.5);
}

/* Pause et arrêt aussi pendant la vérification */
.pt-ai-doc-card[data-status="verifying"] .pt-ai-doc-card-ctrl {
  display: inline-flex;
}

.pt-ai-doc-card[data-status="verifying"] [data-doc-ctrl="pause"],
.pt-ai-doc-card[data-status="verifying"] [data-doc-ctrl="cancel"] {
  display: inline-flex;
}

/* Texte d'une décision dans le dock : lisible sur le fond clair du dock */
#pt-ai-decision-dock .pt-ai-remedy-text {
  color: #57534e;
  font-size: 12px;
}

html.dark #pt-ai-decision-dock .pt-ai-remedy-text {
  color: #57534e;
}

/* Pastille du dock quand seul un document en pause attend */
.pt-ai-validation-pill.has-paused {
  filter: hue-rotate(185deg) saturate(0.6);
}

/* Trace d'une décision sur un document dans le fil */
.pt-ai-doc-ref-line {
  margin: 6px 0;
  flex-shrink: 0;
}

/* Canvas ouvert : la colonne de discussion garde son en-tête et son dock */
#pt-ai-response-zone.pt-ai-canvas-open .pt-ai-canvas-chat-pane > .pt-ai-response-header {
  display: flex !important;
  flex-shrink: 0;
}

.pt-ai-canvas-chat-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Le dock passe au-dessus du canvas plein écran, calé sur la colonne de gauche (position calculée en JS) */
.pt-ai-dock-wrapper.pt-ai-canvas-active .pt-ai-dock-outer {
  position: fixed !important;
  bottom: 22px !important;
  max-width: 750px !important;
  margin: 0 !important;
  z-index: 2000001 !important;
}

/* La discussion défile au-dessus du dock flottant */
.pt-ai-dock-wrapper.pt-ai-canvas-active .pt-ai-canvas-chat-pane #pt-ai-chat-content {
  padding-bottom: 110px !important;
}

/* Le pied du canvas (retouche) n'a plus à laisser la place du dock */
.pt-ai-dock-wrapper.pt-ai-canvas-active .pt-ai-canvas-footer {
  margin-bottom: 0 !important;
}

.pt-ai-dock-wrapper.pt-ai-canvas-active #pt-ai-canvas-workspace .pt-ai-canvas-body {
  padding-bottom: 40px !important;
}

/* Capability Groups & Badges in Welcome Bubble */
.pt-ai-cap-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
}
.pt-ai-cap-tag {
  display: inline-flex;
  align-items: center;
  padding: 2.5px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  transition: all 0.2s ease;
  user-select: none;
}
.pt-ai-cap-tag:hover {
  color: #fff;
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(249, 115, 22, 0.12);
}
