:root {
  --bg:#f4f6f9; --panel:#fff; --ink:#1c2430; --muted:#5c6773; --line:#e2e6ec;
  --accent:#1B365D; --accent-deep:#12233d; --accent2:#487A7B; --warn:#B83A4B;
  --sans: "Nunito Sans", "Source Sans 3", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); }
/* .landing and .app both declare their own `display` below, which — at equal specificity —
   overrides the browser's default `[hidden] { display: none }` UA rule (author CSS always beats
   UA CSS for normal-weight declarations, regardless of source order). Without this, toggling the
   `hidden` attribute in site.js did nothing and both sections rendered stacked at once. */
[hidden] { display: none !important; }
.dot { display:inline-block; width:10px; height:10px; border-radius:50%; background: var(--accent2); margin-right:.4rem; }

/* Landing */
.landing { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.landing-shell { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; max-width: 880px; width: 100%; align-items: center; }
@media (max-width: 720px) { .landing-shell { grid-template-columns: 1fr; } }
.landing-brand { display:flex; align-items:center; gap:.5rem; }
.landing-brand h1 { font-size: 1.9rem; color: var(--accent); margin: 0; }
.landing-lead { font-size: 1.15rem; line-height: 1.5; color: var(--ink); }
.landing-points { list-style: none; padding: 0; margin: 1.2rem 0; display: flex; flex-direction: column; gap: .6rem; }
.landing-points li { display: flex; gap: .6rem; align-items: baseline; }
.landing-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1.8rem; }
.landing-panel h2 { margin-top: 0; color: var(--accent-deep); }
.landing-note-sm { color: var(--muted); font-size: .9rem; }
.landing-actions { margin-top: 1rem; }

.btn { font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; border-radius: 10px; padding: .65rem 1.1rem; border: 1px solid var(--line); background: #fff; color: var(--accent-deep); text-decoration: none; display: inline-block; }
.btn.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.btn-ghost { background: transparent; }
.btn.sm { padding: .35rem .7rem; font-size: .85rem; }

/* App shell — sidebar (past conversations) + main chat, same shape as FaithBot's layout. */
.app { display: flex; height: 100vh; }

.sidebar { width: 260px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.side-top { padding: .9rem .9rem .6rem; border-bottom: 1px solid var(--line); }
.side-top .brand { font-weight: 800; color: var(--accent-deep); display: flex; align-items: center; margin-bottom: .7rem; }
.side-new { width: 100%; text-align: left; }
.side-history { flex: 1; overflow-y: auto; padding: .5rem; }
.side-item { display: block; width: 100%; text-align: left; background: none; border: none; border-radius: 8px; padding: .55rem .6rem; margin-bottom: .15rem; font: inherit; font-size: .88rem; color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item:hover { background: var(--bg); }
.side-item.active { background: var(--accent); color: #fff; }
.side-empty { color: var(--muted); font-size: .85rem; padding: .6rem; }
.side-foot { padding: .7rem .9rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; }
.side-foot .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); font-weight: 700; color: var(--accent-deep); }
.chat-head .icon { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--accent-deep); }
.transcript { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; max-width: 760px; width: 100%; margin: 0 auto; }

/* Mobile: sidebar becomes an overlay drawer, toggled by the header's ☰ button. */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 15; }
@media (max-width: 760px) {
  .chat-head .icon { display: inline-block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
}
.msg { padding: .65rem .85rem; border-radius: 12px; max-width: 82%; line-height: 1.5; font-size: .95rem; }
.msg.user { background: var(--accent); color: #fff; margin-left: auto; }
.msg.assistant { background: var(--panel); border: 1px solid var(--line); }
.msg img { max-width: 100%; border-radius: 10px; margin-top: .5rem; display: block; }
.msg.error { background: #fdeceb; color: var(--warn); border: 1px solid #f3c7c3; }
.composer { display: flex; gap: .5rem; padding: .8rem 1rem; border-top: 1px solid var(--line); background: var(--panel); max-width: 760px; width: 100%; margin: 0 auto; }
.composer .input { flex: 1; font: inherit; font-size: .95rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; resize: none; }
.composer .send { background: var(--accent); color: #fff; border: none; border-radius: 10px; width: 42px; font-size: 1.1rem; cursor: pointer; }
.composer-note { text-align: center; color: var(--muted); font-size: .78rem; margin: 0 0 .7rem; }
.typing { color: var(--muted); font-style: italic; font-size: .88rem; }
