:root { --bg:#1b1230; --panel:#2a1d48; --line:#4a3a78; --gold:#f2c46d; --text:#ffffff; --muted:#cbbfe6; --fs:17px; --ink:#1b1230; }
:root[data-theme="light"] { --bg:#fbf7ee; --panel:#ffffff; --line:#cdbf9f; --gold:#7a4b00; --text:#1b1230; --muted:#4d4262; --ink:#ffffff; }
:root[data-theme="contrast"] { --bg:#000000; --panel:#000000; --line:#ffffff; --gold:#ffff00; --text:#ffffff; --muted:#ffffff; --ink:#000000; }
* { box-sizing:border-box; }
html,body { margin:0; background:var(--bg); color:var(--text); font-family:Georgia,"Times New Roman",serif; }
body { font-size:var(--fs); line-height:1.5; }
a { color:var(--gold); }
button:focus-visible, textarea:focus-visible, a:focus-visible, select:focus-visible { outline:4px solid var(--gold); outline-offset:2px; }

/* Landing / legal pages */
.wrap { max-width:760px; margin:0 auto; padding:24px 18px 60px; }
.hero { text-align:center; padding:40px 0 20px; }
.hero .cross { font-size:3em; color:var(--gold); }
.hero h1 { font-size:1.6em; margin:.2em 0; }
.wrap h1 { font-size:1.5em; }
.wrap h2 { font-size:1.15em; }
.btn { display:inline-block; background:var(--gold); color:var(--ink); padding:14px 28px; border-radius:14px; font-weight:700; text-decoration:none; border:0; font:inherit; font-weight:700; cursor:pointer; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:16px 18px; margin:16px 0; }
footer.site { text-align:center; color:var(--muted); font-size:.75em; margin-top:40px; }
footer.site a { margin:0 8px; }

/* Chat app */
body.app { height:100dvh; display:flex; flex-direction:column; }
header.bar { padding:12px 14px; background:var(--panel); border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:8px; }
header.bar h1 { font-size:1em; margin:0; }
header.bar .tools { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.tools button { background:none; border:2px solid var(--muted); color:var(--text); border-radius:10px; padding:6px 10px; font:inherit; font-size:.7em; cursor:pointer; }
#log { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:14px; }
.msg { max-width:92%; padding:14px 16px; border-radius:16px; white-space:pre-wrap; overflow-wrap:anywhere; }
.ai { background:var(--panel); align-self:flex-start; border:1px solid var(--line); }
.me { background:var(--gold); color:var(--ink); align-self:flex-end; font-weight:600; }
.note { color:var(--muted); font-size:.8em; text-align:center; }
.app-foot { padding:6px 12px 10px; }
.crisis { border:3px solid var(--gold); background:var(--panel); border-radius:16px; padding:14px 16px; }
.crisis strong { color:var(--gold); }
form#f { display:flex; gap:10px; padding:12px; background:var(--panel); border-top:1px solid var(--line); padding-bottom:calc(12px + env(safe-area-inset-bottom)); }
textarea { flex:1; font:inherit; font-size:1em; padding:12px; border-radius:12px; border:2px solid var(--muted); background:#fff; color:#000; resize:none; min-height:58px; max-height:160px; }
#send { background:var(--gold); color:var(--ink); border:0; border-radius:12px; padding:0 20px; font:inherit; font-weight:700; cursor:pointer; }
#send:disabled { opacity:.5; }
#mic { background:none; color:var(--text); border:2px solid var(--muted); border-radius:12px; padding:0 14px; font:inherit; font-size:1.2em; cursor:pointer; }
#mic[hidden] { display:none; }
#mic.on { background:var(--gold); color:var(--ink); border-color:var(--gold); }
#setup { display:none; margin:16px; }
@media (prefers-reduced-motion: no-preference) { .msg { animation:fade .25s ease; } @keyframes fade { from { opacity:0; transform:translateY(4px);} to { opacity:1; transform:none;} } }
