/* AI Analyser (Psonja) mini app.
   Note: .ai_progress is deliberately not .progress_indicator, so utilities.js
   does not adopt it, poll ajaxgetprogress.php and click the popup's next button. */

.ai_app { display: flex; flex-direction: column; min-height: 200px; }

.ai_loading, .ai_notice { padding: 8px 0; font-style: italic; }
.ai_error { padding: 8px 0; color: #c0392b; }

.ai_label { display: block; margin: 8px 0 4px; font-weight: bold; }
.ai_select { width: 100%; margin-bottom: 8px; }
.ai_textarea { width: 100%; box-sizing: border-box; margin-bottom: 8px; }

.ai_button { cursor: pointer; padding: 4px 12px; }
.ai_button[disabled] { cursor: default; opacity: 0.5; }
.ai_link { background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; color: #0a6ebd; }

.ai_running_banner { padding: 8px; margin-bottom: 8px; background: #fdf6e3; border: 1px solid #e0d2a8; }
.ai_running_banner .ai_button { margin-left: 8px; }

.ai_subheading { margin: 16px 0 4px; }
.ai_search { width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 3px 6px; }
.ai_chat_row { padding: 6px 0; border-bottom: 1px solid #eee; }
.ai_chat_line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
/* Two lines of summary; the full text is in the title attribute. */
.ai_chat_summary { margin-top: 2px; color: #555; font-size: 0.9em; line-height: 1.3em; max-height: 2.6em;
   overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ai_show_more { display: inline-block; margin-top: 8px; }
.ai_delete { color: #c0392b; }
.ai_delete_all { display: inline-block; margin: 8px 0 0 12px; }
.ai_confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px; background: #fdf3f2; border: 1px solid #edd; }
.ai_danger { background: #c0392b; color: #fff; border: 1px solid #a5301f; }
.ai_chat_date { color: #777; font-size: 0.9em; }
.ai_badge { padding: 1px 6px; border-radius: 8px; background: #eee; color: #555; font-size: 0.8em; }
.ai_badge_running { background: #d6ecd6; color: #2d6a2d; }

.ai_chat_header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ai_chat_subject { font-weight: bold; }

/* Scrolls inside its own box, so the composer and progress stay visible. */
.ai_transcript { flex: 1 1 auto; max-height: 55vh; overflow-y: auto; padding-right: 4px; font-style:normal; }
.ai_turn { margin-bottom: 12px; }
.ai_turn_user { text-align: left; width: 80%; margin-left:20%; }
.ai_turn_user .ai_turn_body { background: #edf3fc; padding: 6px 8px; border-radius: 4px; white-space: pre-wrap; border-radius:10px; box-shadow: 0px 3px 3px rgb(0 0 0 / 10%); }
.ai_who { display: block; margin-bottom: 2px; color: #555; font-size: 0.9em; }
.ai_turn_body { overflow-x: auto; }
.ai_turn_body table { border-collapse: collapse; }
.ai_turn_body th, .ai_turn_body td { border: 1px solid #ddd; padding: 2px 6px; }
.ai_turn_body pre { overflow-x: auto; background: #f6f6f6; padding: 6px; }

.ai_progress { margin: 8px 0; }
.ai_progress_track { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; }
.ai_progress_bar { height: 100%; width: 0; background: #2d8a4e; transition: width 0.4s ease; }
.ai_progress_text { margin: 4px 0; color: #555; font-style: italic; }

.ai_composer { display: flex; flex-direction: column; margin-top: 8px; }
