/* theme.css: member portal design layer (October 2026 redesign).
   Loaded last, after the portal's own styles. Same green brand; larger, calmer text; one card
   style; the AI chat in brand colours. --ts follows the "Aa" text-size button (portal-ui.js).
   Removing this file restores the previous look. */

:root { --ts: 1; --pt-line: #e2e6e1; --pt-green: #1a7f37; --pt-green-ink: #14612b; --pt-green-soft: #eaf5ed; --pt-muted: #4a4741; }
html[data-text="lg"] { --ts: 1.12; }
html[data-text="xl"] { --ts: 1.25; }

/* Logo in the phone top bar (it had no size and showed at full width) */
.mobile-topbar .brand-logo img { height: 30px; width: auto; max-width: 150px; display: block; }
.mobile-topbar .brand-logo { display: flex; align-items: center; min-width: 0; }
#homeScreen .mobile-topbar { justify-content: flex-start; gap: 8px; }
#homeScreen .mobile-topbar .brand-logo { margin-right: auto; }

/* ---------- Chat ---------- */
.bubble2 { font-size: calc(16px * var(--ts)); line-height: 1.6; }
.msg-row.ai .bubble2 { background: #fff; color: #1c1917; border: 1px solid var(--pt-line); box-shadow: 0 1px 2px rgba(23,21,18,.04), 0 6px 18px rgba(23,21,18,.04); }
.msg-row.ai .bubble2 strong { color: #0f4d22; }
.msg-row.other:not(.ai) .bubble2 { background: #fff; border-color: var(--pt-line); }
.msg-row.system .bubble2 { font-size: calc(14px * var(--ts)); color: var(--pt-muted); }
.msg-timestamp { font-size: calc(12px * var(--ts)); }
.safety-note { font-size: calc(12.5px * var(--ts)); color: var(--pt-muted); }
#aiInput, #humanInput { font-size: calc(16px * var(--ts)) !important; background: #fff !important; border: 2px solid var(--pt-line) !important; }
#aiInput:focus, #humanInput:focus { border-color: var(--pt-green) !important; box-shadow: 0 0 0 4px rgba(26,127,55,.14); outline: none; }
.thread-header .thread-title { font-size: calc(17px * var(--ts)); }
.ai-starter { font-size: calc(15px * var(--ts)) !important; border-color: #cfe6d6 !important; }
.ai-starter:hover { background: var(--pt-green-soft) !important; }
.escalate-cta button { font-size: calc(14px * var(--ts)); min-height: 44px; padding: 8px 16px; }

/* ---------- Home and tools ---------- */
#homeScreen .home-card-title, #homeScreen .tool-card .title { font-size: calc(18px * var(--ts)); }
#homeScreen .home-card-sub, #homeScreen .tool-card .desc { font-size: calc(15.5px * var(--ts)); color: var(--pt-muted); }
.tool-card .title { font-size: calc(17px * var(--ts)); font-weight: 800; }
.tool-card .desc { font-size: calc(15px * var(--ts)); color: var(--pt-muted); line-height: 1.45; }
.hm-h { font-size: calc(20px * var(--ts)); }
.home-card, .tool-card { border: 1px solid var(--pt-line); box-shadow: 0 1px 2px rgba(23,21,18,.04), 0 8px 22px rgba(23,21,18,.04); transition: box-shadow .2s, transform .2s, border-color .2s; }
.home-card:hover, .tool-card:hover { border-color: #bfe0c9; box-shadow: 0 2px 4px rgba(23,21,18,.05), 0 14px 30px rgba(26,127,55,.12); transform: translateY(-2px); }
.home-card:active, .tool-card:active { transform: translateY(0); }
.tool-hero p, .tool-intro p, .tool-screen h2 + p { font-size: calc(16px * var(--ts)); color: var(--pt-muted); line-height: 1.55; }
.tool-field label { font-size: calc(15px * var(--ts)); }
.tool-field input, .tool-field select, .tool-field textarea { font-size: calc(16.5px * var(--ts)) !important; border-width: 2px !important; background: #fff !important; }
.tool-field input:focus, .tool-field select:focus, .tool-field textarea:focus { border-color: var(--pt-green) !important; box-shadow: 0 0 0 4px rgba(26,127,55,.14); outline: none; }
.btn-block { min-height: 54px; font-size: calc(17px * var(--ts)); }

/* ---------- Navigation ---------- */
#sideNav .nav-btn { font-size: calc(15px * var(--ts)); padding: 11px 14px; }
#bottomNav .nav-btn { font-size: 12px; font-weight: 700; }

/* ---------- Text size (Account page) ---------- */
.ts-row { gap: 12px; flex-wrap: wrap; }
.ts-group { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--pt-line); border-radius: 999px; background: #fff; }
.ts-group button { min-width: 48px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-family: var(--font-heading, inherit); font-weight: 800; color: #1c1917; }
.ts-group button.s1 { font-size: 15px; } .ts-group button.s2 { font-size: 18px; } .ts-group button.s3 { font-size: 21px; }
.ts-group button:hover { background: var(--pt-green-soft); }
.ts-group button[aria-pressed="true"] { background: var(--pt-green); color: #fff; }
.ts-group button:focus-visible { outline: 3px solid var(--pt-green); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .home-card, .tool-card { transition: none; }
  .home-card:hover, .tool-card:hover { transform: none; }
}
