/* WAHAJ prototype — how an answer from WAHAJ AI or Wahaj Mentor looks, in all three chats (js/brain.js):
   formatted text, the steps it took, buttons, follow-up questions, "Thinking…" and the Think longer switch.
   Colours come from the theme, so dark and light both work. */

/* ---------- formatted answer text ---------- */
.br-md { color: var(--text); overflow-wrap: anywhere}
.br-md > :first-child { margin-top: 0}
.br-md > :last-child { margin-bottom: 0}
.br-md p { margin: 0 0 .6em}
.br-md b { font-weight: 600; color: var(--text)}
.br-md i { font-style: italic}
.br-md ul, .br-md ol { margin: .2em 0 .7em; padding-inline-start: 1.35em}
.br-md li { margin: .2em 0; padding-inline-start: .15em}
.br-md li::marker { color: var(--muted)}
.br-md ol li::marker { font-weight: 600}
.br-md code { padding: .08em .38em; border-radius: 6px; border: 1px solid var(--line); background: var(--tile); font-family: ui-monospace, Consolas, monospace; font-size: .9em}
.br-md .md-code { margin: .3em 0 .8em; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); overflow-x: auto; font-size: .86em; line-height: 1.5}
.br-md .md-code code { padding: 0; border: 0; background: none}
.br-md blockquote { margin: .3em 0 .8em; padding: 2px 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--accent-2); color: var(--text-2)}
.br-md .md-h { margin: .9em 0 .35em; font-size: 1.02em; font-weight: 700; color: var(--text)}
.br-md hr { margin: .9em 0; border: 0; border-top: 1px solid var(--line)}
.br-md .md-tw { margin: .3em 0 .8em; overflow-x: auto; border-radius: 10px; border: 1px solid var(--line)}
.br-md .md-t { width: 100%; border-collapse: collapse; font-size: .92em}
.br-md .md-t th, .br-md .md-t td { padding: 7px 10px; text-align: start; border-bottom: 1px solid var(--line)}
.br-md .md-t th { font-weight: 600; color: var(--text); background: var(--panel-2)}
.br-md .md-t tr:last-child td { border-bottom: 0}
.br-caret { display: inline-block; width: 8px; height: 1em; margin-inline-start: 2px; vertical-align: -.12em; border-radius: 2px; background: var(--accent-2); animation: blink .8s infinite}
.reduce-motion .br-caret { animation: none}

/* ---------- what it looked at, and how long it thought ---------- */
.br-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px}
.br-step { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--text-2)}
.br-step .ico { color: var(--accent-2-text)}
.br-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--accent-2); animation: spin .8s linear infinite}
.br-thought { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12.5px; color: var(--muted)}
.br-thought .ico { color: var(--accent-2-text)}
.br-think { display: inline-flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 14px; color: var(--text-2)}
.br-dots { display: inline-flex; gap: 4px}
.br-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); animation: mcDot 1.2s ease-in-out infinite}
.br-dots i:nth-child(2) { animation-delay: .15s}
.br-dots i:nth-child(3) { animation-delay: .3s}
.reduce-motion .br-dots i, .reduce-motion .br-spin { animation: none}
@keyframes spin { to { transform: rotate(360deg)} }
.br-note { margin-top: 8px; font-size: 12.5px; color: var(--muted)}

/* ---------- buttons an answer carries, and follow-up questions ---------- */
.br-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px}
.br-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--accent-line); background: var(--panel-2); font-size: 13.5px; font-weight: 600; color: var(--text); text-align: start}
.br-btn .ico { flex: none; color: var(--accent)}
.br-btn:hover { border-color: var(--accent)}
.br-fu { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 12px}
.br-fu button { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 32px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); text-align: start}
.br-fu button .ico { flex: none; color: var(--accent-2-text)}
.br-fu button:hover { border-color: var(--accent-2-line); color: var(--text)}

/* ---------- Think longer ---------- */
.br-deep { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2)}
.br-deep .ico { color: var(--muted)}
.br-deep:hover { border-color: var(--line-3); color: var(--text)}
.br-deep.on { border-color: var(--accent-2); color: var(--text)}
.br-deep.on .ico { color: var(--accent-2-text)}
.br-deep.icon { width: 34px; height: 34px; padding: 0; justify-content: center; flex: none}
.br-deep.icon span { display: none}

/* ---------- where answers come from (Mentor page header) ---------- */
.br-src { margin-inline-start: 4px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--muted)}
.br-src.on { border-color: var(--accent-2); color: var(--accent-2-text)}

/* ---------- WAHAJ AI panel (top bar) ---------- */
.ai-panel-wrap { width: 440px}
.ai-panel { height: 640px}
.aip-h { gap: 10px}
.aip-ht { flex: 1; min-width: 0}
.aip-h small i.on { background: var(--accent-2)}
.aip-h .ai-x:first-of-type { margin-inline-start: 0}
.aip-body { gap: 16px; padding: 16px 16px 8px}
.aip-hello { display: flex; flex-direction: column; align-items: center; margin: auto 0; padding: 12px 6px; text-align: center}
.aip-hello h4 { margin: 12px 0 0; font-size: 22px; font-weight: 600; color: var(--text)}
.aip-hello p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-2)}
.aip-sug { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 18px}
.aip-sug button { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); font-size: 14px; color: var(--text); text-align: start}
.aip-sug button .ico { color: var(--accent)}
.aip-sug button:hover { border-color: var(--accent-line)}
.aip-m.bot { align-items: flex-start; gap: 10px}
.aip-av { flex: none; margin-top: 1px}
.aip-a { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.55; color: var(--text)}
.aip-m.me .aip-bb { max-width: 320px; white-space: pre-wrap; overflow-wrap: anywhere}
.aip-acts { display: flex; gap: 2px; margin-top: 6px; margin-inline-start: -6px}
.aip-acts button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--muted)}
.aip-acts button:hover { background: var(--tile); color: var(--text)}
.aip-comp { margin: 6px 12px 0; padding: 10px 10px 8px 14px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg-deep)}
.aip-comp:focus-within { border-color: var(--line-3)}
.aip-comp textarea { display: block; width: 100%; min-height: 24px; max-height: 120px; padding: 2px 0; resize: none; border: 0; outline: 0; background: none; font: inherit; font-size: 14.5px; line-height: 1.45; color: var(--text)}
.aip-comp textarea::placeholder { color: var(--muted)}
.aip-tools { display: flex; align-items: center; gap: 4px; margin-top: 8px}
.aip-tools .sp { flex: 1}
.aip-ib { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--text-2)}
.aip-ib:hover { background: var(--tile); color: var(--text)}
.aip-snd { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--tile-hi); color: var(--muted)}
.aip-comp.has .aip-snd { background: var(--accent); color: var(--accent-ink)}
.aip-snd.stop { background: var(--text); color: var(--bg)}
.aip-note { display: block; padding: 8px 14px 10px; font-size: 11.5px; color: var(--muted); text-align: center}

/* ---------- Mentor page ---------- */
.cv-u { align-items: center; gap: 6px}
.cv-edit { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); opacity: 0; transition: opacity .15s}
.cv-u:hover .cv-edit, .cv-edit:focus-visible { opacity: 1}
.cv-edit:hover { background: var(--tile); color: var(--text)}
.cv-send.stop { background: var(--text); color: var(--bg)}
.cv-at .br-md { line-height: 1.7}
.cv-a .br-fu { margin-top: 14px}
.cv-tools .br-deep { height: 34px}

/* ---------- the chat inside a mission ---------- */
.mch-col { min-width: 0; max-width: 316px; display: flex; flex-direction: column}
.mch-col .mch-b { max-width: none}
.mch-b .br-md { color: var(--text)}
.mch-b .br-btns { margin-top: 10px}
.mch-b .br-btn { min-height: 32px; padding: 4px 11px; font-size: 12.5px}
.mch-acts { display: flex; gap: 2px; margin-top: 4px}
.mch-acts button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: var(--muted)}
.mch-acts button:hover { background: var(--tile); color: var(--text)}
.mch-col .br-fu { margin-top: 6px}
.mch-col .br-fu button { font-size: 12.5px; min-height: 30px}
.mch-in .br-deep.icon { width: 34px; height: 34px; border-color: transparent}
.mch-in .br-deep.icon.on { border-color: var(--accent-2)}
/* V6G-12: a summary or a learning snapshot the app writes itself, shown as one calm card above any note from the AI model */
.br-md.br-card { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 10px}
.br-md.br-card .md-h:first-child { margin-top: 0; font-size: 1.08em}
.br-md.br-card p + p { margin-top: .2em}
.br-md.br-card + .br-btns { margin-top: -2px; margin-bottom: 8px}
