"""Render the live thought card as HTML."""
from __future__ import annotations
from card_engine import ActiveCard, CardState
def render_card(active: ActiveCard) -> str:
"""Render the thought card HTML based on current state."""
if active.state == CardState.IDLE:
return ""
card = active.card
sections = []
# Situation + Thought (always visible once triggered)
if active.state.value != "idle":
thought_text = card.automatic_thought or "..."
sections.append(f"""
A calmer way to untangle your thoughts
When you're caught in a worry or a harsh thought, it's hard to see it clearly from the inside.
REFRAME is a gentle, judgment-free space to talk it through — and watch an unhelpful thought
become a fairer, kinder one.
How it helps you:
See the thinking trap
It gently names patterns like catastrophizing or all-or-nothing thinking — the ones that are hard to spot in your own head.
Questions, not lectures
Rather than telling you what to think, it asks — what supports this thought, and what doesn't? You stay in control.
Reframes you actually believe
The balanced thought is yours, in your own words — which is exactly why it sticks with you.
See yourself grow
Saved cards and your pattern tracker reveal what keeps coming up — and noticing is where change begins.
💬 Just talk — by voice or text. No jargon, no pressure. It's grounded in
Cognitive Behavioral Therapy (CBT), the most
evidence-based approach for reshaping unhelpful thinking.
A supportive companion — not a replacement for professional care. If you're ever in crisis,
it will surface helplines right away.
"""