/* The AI inspector is a long evidence workspace: keep its header in normal flow. */
.workspace:has(> [data-view-panel="ai-player"].active) > .topbar { position: static; }

#ai-player-task-rule-editor { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
#ai-player-task-rule-editor h4 { margin: 1rem 0 .6rem; font-size: 1rem; }
#ai-player-task-rule-editor p { white-space: normal; overflow-wrap: anywhere; margin: .6rem 0; }
#ai-player-task-rule-editor > p { color: var(--muted, #aeb7d7); font-size: .88rem; }
#ai-player-task-rule-editor form.ai-player-controls {
  display: flex; flex-wrap: wrap; align-items: end; gap: 1rem;
  margin: 1rem 0; padding: 1rem; border: 1px solid var(--border, #263e56);
  border-radius: 12px; background: rgba(5, 15, 27, .35);
}
#ai-player-task-rule-editor form.ai-player-controls label {
  flex: 1 1 15rem; max-width: 100%; margin: 0;
  font-size: .82rem; color: #c8d7e8; line-height: 1.4;
}
#ai-player-task-rule-editor form:nth-of-type(2) label { flex: 0 1 34rem; }
#ai-player-task-rule-editor form:nth-of-type(3) label:last-of-type { flex: 0 1 8rem; }
#ai-player-task-rule-editor input {
  width: 100%; min-width: 0; max-width: 100%; min-height: 44px;
  padding: .65rem .75rem; border-radius: 8px; font-weight: 500;
}
#ai-player-task-rule-editor button {
  width: auto; max-width: 100%; min-height: 44px; margin: 0; padding: .65rem 1rem;
  flex: 0 0 auto; white-space: normal; border-radius: 8px; font-size: .82rem; font-weight: 700;
}
#ai-player-task-rule-editor form button { background: #7555d9; color: #fff; }
#ai-player-task-rule-editor button:focus-visible,
#ai-player-task-rule-editor input:focus-visible { outline: 3px solid #b99bff; outline-offset: 3px; }
@media (max-width: 680px) {
  #ai-player-task-rule-editor form.ai-player-controls { padding: .85rem; gap: .85rem; }
  #ai-player-task-rule-editor form.ai-player-controls label,
  #ai-player-task-rule-editor form:nth-of-type(2) label,
  #ai-player-task-rule-editor form:nth-of-type(3) label:last-of-type { flex: 1 1 100%; }
  #ai-player-task-rule-editor form button { max-width: 100%; }
}
