.ai-activity {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 20;
  font-size: 13px;
  color: #202b36;
}
#aiActivityDock { flex: 0 0 40px; height: 40px; }
.ai-activity[hidden], .ai-activity [hidden] { display: none !important; }
.ai-activity button { font: inherit; letter-spacing: 0; }
.ai-activity-toggle {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 9px 13px;
  border: 1px solid #c6d4e3; border-radius: 8px;
  background: #fff; color: #263b51;
  box-shadow: 0 3px 14px #162d4a26;
  max-width: 100%;
}
.ai-activity-toggle:hover { background: #eef4fa; }
.ai-activity-toggle:focus-visible, .ai-activity-row:focus-visible { outline: 2px solid #1267d6; outline-offset: 2px; }
.ai-activity-dot {
  display: inline-block; flex: 0 0 14px; width: 14px; height: 14px;
  border: 2px solid #cad5df; border-radius: 50%; box-sizing: border-box;
}
.ai-activity-dot.is-running { border-color: #c6d9ed; border-top-color: #1267d6; animation: ai-activity-spin 1s linear infinite; }
.ai-activity-dot.is-waiting { border-color: #b67b0c; background: #fff0c8; }
.ai-activity-panel {
  position: absolute; bottom: 50px; left: 0;
  width: min(350px, calc(100vw - 24px)); max-height: min(520px, calc(100dvh - 90px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid #c6d4e3; border-radius: 8px;
  box-shadow: 0 8px 32px #162d4a30;
}
.ai-activity-heading { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #e5ebf1; }
.ai-activity-close { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; font-size: 22px !important; }
.ai-activity-close:hover { background: #edf2f7; }
.ai-activity-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.ai-activity-row {
  display: flex; align-items: center; width: 100%; gap: 10px;
  padding: 11px 8px; border: 0; border-radius: 4px;
  background: transparent; color: inherit; text-align: left;
}
.ai-activity-row:hover { background: #edf4fc; }
.ai-activity-copy { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.ai-activity-copy strong { font-weight: 650; }
.ai-activity-copy small { color: #586b7c; font-size: 12px; }
.ai-activity-message { margin: 0; padding: 12px 14px; color: #586b7c; }
.ai-activity-error { color: #a33232; }
@media (max-width: 1100px) {
  /* The stacked shell cannot use a desktop dock anchor. Override the inline
     coordinates immediately, before resize observers can update them. */
  .ai-activity {
    left: 12px !important;
    bottom: 12px !important;
    max-width: calc(100vw - 24px) !important;
  }
  .ai-activity-panel {
    max-height: min(520px, calc(100dvh - 90px)) !important;
  }
}
@keyframes ai-activity-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-activity-dot.is-running { animation: none; border-color: #1267d6; } }
