/* page-ai.css — extracted from style.css 2026-05-27 (UX-6 first cut).
 *
 * /ai unified AI agent UI styles (originally style.css commit 2.25).
 * Selectors are unchanged from the extraction — cascade order
 * preserves bug-for-bug compat with the inline version.
 *
 * Loaded AFTER style.css via base.html so page-specific rules win
 * ties against the broader page styles.
 */

/* ─── /ai unified AI agent (commit 2.25) ─────────────────────────────
   Question textarea + answer card + conversation list. Mode-1 visual
   treatment per the directive. */
.ai-page { max-width: 1080px; margin: 0 auto; }

.ai-ask-block {
  margin-top: 8px;
  width: 100%;
}
#ai-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
#ai-question {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  box-sizing: border-box;
  resize: vertical;
  min-height: 80px;
}
#ai-question:focus {
  outline: 2px solid var(--brand);
  border-color: var(--brand);
}
.ai-ask-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ai-tip { font-size: 14px; }

.ai-status {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-soft);
  color: var(--text-2);
}
.ai-status-ok    { background: var(--green-bg, #ecfdf5); color: var(--green-deep, var(--green)); }
.ai-status-warn  { background: var(--yellow-bg, #fffbeb); color: var(--yellow, #b45309); }
.ai-status-error { background: var(--red-bg, #fef2f2); color: var(--red); }

/* Inline ack form on alerts (Phase 5, commit 2.28) */
.alert-card-ack-form { display:inline-block; margin:0; }
.alert-card-ack-form > summary {
  cursor:pointer; list-style:none; user-select:none;
}
.alert-card-ack-form > summary::-webkit-details-marker { display:none; }
.alert-card-ack-fields {
  display:flex; flex-direction:column; gap:10px;
  padding:12px; margin-top:8px;
  background:var(--bg-soft);
  border:1px solid var(--border); border-radius:6px;
  min-width:420px;
}
.alert-card-ack-label { display:flex; flex-direction:column; gap:4px; font-size:var(--fs-xs); color:var(--text-2); }
.alert-card-ack-label textarea, .alert-card-ack-label select {
  font-family:inherit; font-size:14px;
  padding:6px 8px; border-radius:4px;
  border:1px solid var(--border); background:var(--bg-elev);
}
.alert-card-ack-required { color:var(--red); font-weight:600; }
.alert-card-ack-actions { display:flex; gap:8px; align-items:center; }
.alert-card-ack-note {
  display:block; margin-top:6px; padding:6px 10px;
  background:var(--bg-soft); border-left:3px solid var(--green, #16a34a);
  border-radius:4px; font-size:var(--fs-xs); color:var(--text);
}
.alert-card-foot-link { font-size:var(--fs-xs); text-decoration:none; color:var(--brand, #f97316); }
.alert-card-foot-link:hover { text-decoration:underline; }

/* Linked alerts + bulk-ack on /ai/conversation (Phase 5, commit 2.28) */
.ai-link-alerts { list-style:none; padding:0; margin:0; }
.ai-link-alert { margin-bottom:6px; font-size:14px; }
.ai-link-alert > a {
  display:flex; align-items:center; gap:8px;
  padding:8px 12px; background:var(--bg-elev);
  border:1px solid var(--border); border-radius:6px;
  text-decoration:none; color:inherit;
}
.ai-link-alert > a:hover { border-color:var(--brand, #f97316); }
.ai-link-alert-headline { flex:1; font-weight:500; }
.ai-link-alert-note {
  margin:4px 0 0 24px; padding:4px 10px;
  background:var(--bg-soft); border-left:2px solid var(--green, #16a34a);
  font-style:italic; color:var(--text-2); font-size:var(--fs-xs); border-radius:3px;
}

.ai-bulk-ack-form {
  padding:14px; background:var(--bg-elev);
  border:1px solid var(--border); border-radius:8px;
}
.ai-bulk-ack-list { list-style:none; padding:0; margin:0 0 12px; }
.ai-bulk-ack-row { padding:6px 0; border-bottom:1px solid var(--border); }
.ai-bulk-ack-row:last-child { border-bottom:none; }
.ai-bulk-ack-row label {
  display:flex; align-items:center; gap:8px;
  cursor:pointer; font-size:14px;
}
.ai-bulk-ack-headline { flex:1; }
.ai-bulk-ack-note {
  display:flex; flex-direction:column; gap:4px;
  margin:8px 0 12px; font-size:var(--fs-xs);
}
.ai-bulk-ack-note textarea {
  font-family:inherit; font-size:14px;
  padding:6px 8px; border-radius:4px;
  border:1px solid var(--border); background:var(--bg);
}

.pill-red    { background:var(--red-bg, #fef2f2); color:var(--red); }
.pill-yellow { background:var(--yellow-bg, #fffbeb); color:var(--yellow, #b45309); }
.pill-blue   { background:var(--blue-bg, #eff6ff); color:var(--blue, #1d4ed8); }

/* AI investigations feed on /alerts (Phase 5, commit 2.27) */
.ai-invest-list { list-style: none; padding: 0; margin: 0; }
.ai-invest-row { margin-bottom: 10px; }
.ai-invest-link {
  display: block;
  padding: 14px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ai-invest-link:hover {
  border-color: var(--brand, #f97316);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.ai-invest-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 14px;
}
.ai-invest-when { font-weight: 600; color: var(--text-2); }
.ai-invest-meta { margin-left: auto; }
.ai-invest-q {
  margin: 4px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.ai-invest-ans {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  background: var(--bg-soft);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--brand, #f97316);
}
.ai-invest-foot {
  margin: 6px 0 0;
  font-size: 14px;
}

.ai-answer-card,
.ai-question-card {
  margin-top: 14px;
  padding: 18px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ai-q-label {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  font-weight: 600;
}
.ai-q-text {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}
.ai-answer-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}
.ai-answer-body h2 { font-size: 16px; font-weight: 600; margin: 14px 0 6px; }
.ai-answer-foot {
  margin-top: 14px;
  font-size: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
}

/* Conversation sidebar list */
.ai-convo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elev);
}
.ai-convo-row { border-bottom: 1px solid var(--border-soft); }
.ai-convo-row:last-child { border-bottom: 0; }
.ai-convo-link {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 12px 18px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
}
.ai-convo-link:hover { background: var(--bg-soft); }
.ai-convo-when {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-mute);
}
.ai-convo-q {
  color: var(--text);
}
.ai-convo-meta {
  font-size: 14px;
  white-space: nowrap;
}

/* Trace view (per-conversation page) */
.ai-trace-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-trace-row {
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  font-size: 14px;
}
.ai-trace-user      { border-left: 3px solid var(--brand); }
.ai-trace-assistant { border-left: 3px solid var(--green); }
.ai-trace-tool      { border-left: 3px solid var(--yellow); }
.ai-trace-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 14px;
}
.ai-trace-role { font-weight: 600; }
.ai-trace-when { font-family: var(--mono); font-size: 14px; }
.ai-trace-content { line-height: 1.6; color: var(--text); }
.ai-trace-tool-details summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--text-mute);
}
.ai-trace-section { margin-top: 10px; }
.ai-trace-json {
  background: var(--bg-soft);
  padding: 8px 10px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 14px;
  overflow-x: auto;
  margin: 4px 0;
  max-height: 360px;
}

