.ai-flow-actions { display:flex; flex-wrap:wrap; gap:8px; }
.ai-flow-button { min-height:44px; padding:10px 14px; border:1px solid var(--divider); border-radius:12px; background:var(--card); color:var(--text); font:inherit; cursor:pointer; overflow-wrap:anywhere; }
.ai-flow-button.primary { background:var(--accent); color:var(--accent-text,#10141b); border-color:transparent; font-weight:600; }
.ai-flow-button:disabled { opacity:.5; cursor:default; }
.ai-flow-button:focus-visible,.ai-flow-pick:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
#aiFlowModal { top:var(--vp-offset-top,0px); height:var(--vp-height,100dvh); bottom:auto; box-sizing:border-box; }
.ai-flow-dialog { width:min(640px,100%); max-height:100%; display:flex; flex-direction:column; overflow:hidden; background:var(--card); border-radius:18px; color:var(--text); }
.ai-flow-heading { display:flex; flex-shrink:0; align-items:center; justify-content:space-between; gap:12px; padding:16px 16px 10px; }
.ai-flow-heading h2 { font-size:20px; margin:0; }
.ai-flow-heading button { flex-shrink:0; }
.ai-flow-body { padding:0 16px 16px; overflow:auto; min-height:0; overscroll-behavior:contain; }
.ai-flow-note { color:var(--text2); font-size:14px; line-height:1.5; margin:10px 0; }
.ai-flow-status { flex-shrink:0; padding:0 16px 12px; font-size:14px; line-height:1.4; white-space:pre-wrap; }
.ai-flow-status:empty { display:none; }
.ai-flow-status.error { color:#ffaaaa; }
.ai-flow-footer { padding:12px 16px; border-top:1px solid var(--divider); flex-shrink:0; }
.ai-flow-footer:empty { display:none; }
.ai-flow-footer button { flex:1; }
.ai-flow-field { width:100%; min-height:86px; resize:vertical; background:var(--input-bg,var(--bg)); color:var(--text); border:1px solid var(--divider); border-radius:12px; padding:12px; margin:8px 0 14px; font:inherit; line-height:1.5; box-sizing:border-box; }
.ai-flow-editor { min-height:180px; }
.ai-flow-source { margin:10px 0; padding:12px; border:1px solid var(--divider); border-radius:12px; }
.ai-flow-source p { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.5; margin:8px 0; }
.ai-flow-source summary { cursor:pointer; min-height:44px; display:flex; align-items:center; color:var(--accent); }
.ai-flow-consent { display:flex; align-items:flex-start; gap:10px; line-height:1.5; padding:12px 0; }
.ai-flow-consent input,.ai-flow-pick input { width:22px; height:22px; flex-shrink:0; margin:2px 0 0; accent-color:var(--accent); }
.ai-flow-draft-list,.ai-flow-choices,.ai-flow-picker { display:grid; gap:10px; }
.ai-flow-choices button { text-align:left; padding:16px; }
.ai-flow-choices strong,.ai-flow-choices span,.ai-flow-start strong,.ai-flow-start span { display:block; }
.ai-flow-choices span,.ai-flow-start span { font-size:14px; font-weight:400; margin-top:4px; }
.ai-flow-pick { display:flex; gap:12px; border:1px solid var(--divider); border-radius:12px; padding:12px; cursor:pointer; }
.ai-flow-pick > span { min-width:0; }
.ai-flow-pick .ai-flow-note { display:block; margin:0 0 4px; }
.ai-flow-pick-text { display:block; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.45; }
.ai-flow-start { flex-shrink:0; margin:10px 12px; padding:14px; text-align:left; border-color:var(--accent); background:var(--outgoing,var(--card)); }
.ai-flow-chat-entry { flex-shrink:0; border-radius:0; border-width:1px 0; min-height:48px; color:var(--accent); background:var(--header); text-align:left; padding-left:16px; font-size:15px; font-weight:600; }
@media (max-width:600px) {
  .ai-flow-dialog { border-radius:16px; }
  .ai-flow-field { font-size:16px; }
  .ai-flow-footer button:first-child { flex-basis:100%; }
  .ai-flow-footer button { font-size:15px; padding:10px; }
}

.msg-companion-label { font-size:12px; font-weight:600; padding:4px 0 6px; color:var(--accent,#8a5bb7); }
#aiFlowBody details .ai-flow-field { margin-bottom:12px; }
.companion-proposal h4 { margin:4px 0; }
#companionText { min-height:130px; }
