@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ═══════════════════════════════════════════════════════
   VITAL QUESTIONS — Design System v2
   Fonts: Libre Baskerville (serif) + DM Sans (sans)
   Palette: Warm editorial neutrals, deep brown header
   ═══════════════════════════════════════════════════════ */

:root {
  --bg:             oklch(98% 0.008 60);
  --bg-card:        #FFFFFF;
  --bg-accent:      oklch(95.5% 0.018 58);
  --text:           oklch(14% 0.022 50);
  --text-secondary: oklch(42% 0.018 52);
  --text-light:     oklch(60% 0.012 52);
  --accent:         oklch(38% 0.10 46);
  --accent-hover:   oklch(30% 0.10 46);
  --accent-light:   oklch(74% 0.07 53);
  --border:         oklch(91% 0.014 58);
  --shadow:         0 4px 20px oklch(0% 0 0 / 0.08);
  --shadow-lg:      0 16px 48px oklch(0% 0 0 / 0.13);
  --radius:         12px;
  --serif:          'Libre Baskerville', Georgia, serif;
  --sans:           'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --chat-ai:        oklch(95.5% 0.018 58);
  --highlight:      oklch(93% 0.03 58);
  --green:          oklch(42% 0.12 155);
  --green-bg:       oklch(94% 0.04 155);
  --red:            oklch(42% 0.12 25);
  --red-bg:         oklch(95% 0.04 25);
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ═══ HEADER ═══════════════════════════════════════════ */

header {
  background: oklch(13% 0.028 46);
  color: oklch(96% 0.008 60);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, oklch(45% 0.08 50 / 0.22) 0%, transparent 65%);
  pointer-events: none;
}

.header-content {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto;
  padding: 52px 24px 44px;
  text-align: center;
}

.header-ornament {
  display: block; margin: 0 auto 18px;
  width: 28px; height: 28px;
  opacity: 0.4; color: inherit;
}

.header-content h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0;
}

.header-rule {
  width: 44px; height: 2px;
  background: var(--accent-light);
  margin: 18px auto;
  border-radius: 2px;
  opacity: 0.65;
}

.header-content .subtitle {
  font-size: 0.97rem;
  font-weight: 300;
  opacity: 0.72;
  max-width: 520px;
  margin: 0 auto 12px;
  line-height: 1.65;
}

.header-content .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.82rem;
  opacity: 0.45;
  max-width: 480px;
  margin: 0 auto;
}

/* ═══ NAV ═══════════════════════════════════════════════ */

nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 6px oklch(0% 0 0 / 0.05);
}

.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 2px;
  padding: 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }

.nav-btn {
  font-family: var(--sans);
  font-size: 0.83rem; font-weight: 500;
  padding: 9px 14px;
  margin: 5px 2px;
  background: none; border: none;
  color: var(--text-secondary); cursor: pointer;
  white-space: nowrap;
  border-radius: 8px;
  transition: all 0.18s ease;
}
.nav-btn:hover { color: var(--text); background: var(--bg-accent); }
.nav-btn.active { background: var(--accent); color: #FAF8F5; }

.install-btn {
  margin-left: auto;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
  padding: 6px 13px;
  background: var(--bg-accent); color: var(--accent);
  border: 1px solid var(--border); border-radius: 20px;
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.install-btn:hover { background: var(--accent); color: #FAF8F5; border-color: var(--accent); }

/* ═══ MAIN / VIEWS ══════════════════════════════════════ */

main {
  max-width: 1100px; margin: 0 auto;
  padding: 36px 18px 80px;
}

.view { display: none; }
.view.active { display: block; animation: fadeUp 0.26s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ═══ WELCOME / PATHWAYS ════════════════════════════════ */

.welcome-area {
  max-width: 860px; margin: 0 auto;
  text-align: center;
  transition: all 0.4s ease;
}
.welcome-area.hidden { display: none; }

.welcome-area h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.welcome-area > p {
  font-size: 0.97rem; color: var(--text-secondary);
  line-height: 1.75; max-width: 560px;
  margin: 0 auto 28px;
}

/* ── Category color tokens (applied via data-tag) ── */
.pathway-card[data-tag="Foundations"]    { --tag-stripe:#8B6340; --tag-bg:#F5EDE0; --tag-color:#5C3D18; }
.pathway-card[data-tag="Big Questions"]  { --tag-stripe:#3D6B8C; --tag-bg:#E0EDF5; --tag-color:#1D4A6B; }
.pathway-card[data-tag="Jesus"]          { --tag-stripe:#A0782A; --tag-bg:#F5EEE0; --tag-color:#6B4A10; }
.pathway-card[data-tag="History"]        { --tag-stripe:#6B4A5C; --tag-bg:#F0E8EF; --tag-color:#4A2A3C; }
.pathway-card[data-tag="Evidence"]       { --tag-stripe:#3D6B54; --tag-bg:#E0F0EA; --tag-color:#1D4A34; }
.pathway-card[data-tag="Hard Questions"] { --tag-stripe:#5C5C7A; --tag-bg:#EAEAF5; --tag-color:#38385A; }
.pathway-card[data-tag="Science"]        { --tag-stripe:#3D7070; --tag-bg:#E0F0F0; --tag-color:#1D4A4A; }
.pathway-card[data-tag="Right & Wrong"]  { --tag-stripe:#8B6B30; --tag-bg:#F5EEE0; --tag-color:#6B4A10; }
.pathway-card[data-tag="Faith"]          { --tag-stripe:#7B5E3C; --tag-bg:#F5EDE0; --tag-color:#5C3D18; }
.pathway-card[data-tag="Practical"]      { --tag-stripe:#5C7A5C; --tag-bg:#E8F2E8; --tag-color:#2A4A2A; }

.pathway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.pathway-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.2s;
  text-align: left; font: inherit; color: inherit;
  width: 100%; display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 4px oklch(0% 0 0 / 0.05);
}
.pathway-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent-light);
}
.pathway-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Colored top stripe */
.pathway-stripe {
  height: 4px; width: 100%;
  background: var(--tag-stripe, var(--accent));
  flex-shrink: 0;
}

.pathway-body { padding: 14px 16px 16px; flex: 1; }

/* Category tag chip */
.pathway-tag {
  display: inline-block;
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px;
  margin-bottom: 9px;
  background: var(--tag-bg, var(--bg-accent));
  color: var(--tag-color, var(--accent));
}

/* Hide emoji icon — tag chip replaces it */
.pathway-icon { display: none; }

.pathway-q {
  font-family: var(--serif);
  font-size: 0.94rem; line-height: 1.42;
  color: var(--text); margin-bottom: 5px;
  text-wrap: pretty;
}

.pathway-hint {
  font-size: 0.76rem; color: var(--text-light);
  line-height: 1.5;
}

/* ═══ CONVO ACTIONS ══════════════════════════════════════ */

.convo-actions {
  display: flex; gap: 8px; margin-bottom: 14px;
  align-items: center; flex-wrap: wrap;
}

.new-convo-btn {
  display: none;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 500;
  padding: 6px 14px; background: var(--bg-accent);
  color: var(--text-secondary); border: 1px solid var(--border);
  border-radius: 20px; cursor: pointer; transition: all 0.18s;
  align-items: center; gap: 5px;
}
.new-convo-btn:hover { background: var(--accent); color: #FAF8F5; border-color: var(--accent); }
.new-convo-btn.visible { display: inline-flex; }

.download-chat-btn {
  display: none;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 500;
  padding: 6px 14px; background: var(--green-bg); color: var(--green);
  border: 1px solid oklch(75% 0.07 155); border-radius: 20px;
  cursor: pointer; transition: all 0.18s;
  align-items: center; gap: 5px;
}
.download-chat-btn:hover { background: var(--green); color: #FAF8F5; border-color: var(--green); }
.download-chat-btn.visible { display: inline-flex; }

/* ═══ TOPIC DETAIL ══════════════════════════════════════ */

.topic-detail { max-width: 760px; margin: 0 auto; }

.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.88rem; color: var(--accent);
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); margin-bottom: 20px;
  transition: color 0.18s;
}
.back-btn:hover { color: var(--accent-hover); }

.detail-header { margin-bottom: 28px; }
.detail-header h2 {
  font-family: var(--serif); font-size: 1.65rem;
  margin-bottom: 10px; line-height: 1.3; letter-spacing: -0.01em;
}
.detail-header .detail-desc { font-size: 0.97rem; color: var(--text-secondary); line-height: 1.72; }

.section-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px;
  box-shadow: 0 1px 4px oklch(0% 0 0 / 0.04);
}
.section-block h3 {
  font-family: var(--serif); font-size: 1.08rem;
  margin-bottom: 12px; color: var(--accent-hover);
  letter-spacing: -0.01em;
}
.section-block p, .section-block li {
  font-size: 0.93rem; color: var(--text); line-height: 1.8; margin-bottom: 6px;
}
.section-block ul, .section-block ol { padding-left: 20px; }

.quote-block {
  border-left: 3px solid var(--accent-light);
  padding: 13px 17px; margin: 14px 0;
  background: var(--highlight); border-radius: 0 8px 8px 0;
  font-family: var(--serif); font-style: italic;
  font-size: 0.92rem; line-height: 1.72; color: var(--text-secondary);
}
.quote-block .attribution {
  display: block; font-family: var(--sans); font-style: normal;
  font-size: 0.78rem; margin-top: 8px; color: var(--text-light);
}

.evidence-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.83rem; }
.evidence-table th, .evidence-table td {
  padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.evidence-table th {
  background: var(--bg-accent); font-weight: 600;
  color: var(--accent-hover); font-size: 0.76rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.evidence-table .highlight-row { background: var(--highlight); font-weight: 600; }

.discussion-prompt {
  background: var(--bg-accent); border-radius: var(--radius);
  padding: 16px 20px; margin: 14px 0;
}
.discussion-prompt h4 {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); margin-bottom: 8px;
}
.discussion-prompt ul { list-style: none; padding: 0; }
.discussion-prompt li {
  padding: 5px 0 5px 18px; position: relative; font-size: 0.91rem;
}
.discussion-prompt li::before {
  content: '?'; position: absolute; left: 0;
  font-weight: 700; color: var(--accent);
}

.counterpoint {
  background: oklch(97% 0.02 55); border: 1px solid oklch(88% 0.03 55);
  border-radius: var(--radius); padding: 16px 20px; margin: 14px 0;
}
.counterpoint h4 { font-size: 0.78rem; font-weight: 700; color: oklch(45% 0.08 52); margin-bottom: 6px; }
.counterpoint p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.72; }

.source-tag {
  display: inline-block; background: var(--green-bg); color: var(--green);
  font-size: 0.69rem; font-weight: 600; padding: 2px 8px;
  border-radius: 12px; margin-top: 8px; letter-spacing: 0.03em;
}

/* ═══ CHAT ═══════════════════════════════════════════════ */

.dialogue-container { max-width: 760px; margin: 0 auto; }

/* API Settings */
.api-settings {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 18px;
}
.api-settings summary {
  cursor: pointer; font-size: 0.86rem; font-weight: 500;
  color: var(--accent); user-select: none;
}
.api-settings-inner { margin-top: 12px; }
.api-settings label {
  font-size: 0.8rem; font-weight: 500;
  color: var(--text-secondary); display: block; margin-bottom: 4px;
}
.api-input {
  width: 100%; font-family: var(--sans); font-size: 0.88rem;
  padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg);
  color: var(--text); outline: none; margin-bottom: 10px;
  transition: border-color 0.18s;
}
.api-input:focus { border-color: var(--accent); }
.api-status { font-size: 0.78rem; padding: 5px 11px; border-radius: 6px; display: inline-block; }
.api-status.connected   { background: var(--green-bg); color: var(--green); }
.api-status.disconnected { background: var(--red-bg); color: var(--red); }

.chat-area {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 0; max-height: 62vh;
  overflow-y: auto; padding: 22px 20px;
  margin-bottom: 12px;
  scroll-behavior: smooth;
  box-shadow: 0 1px 4px oklch(0% 0 0 / 0.04);
}

.chat-msg { display: flex; gap: 10px; max-width: 88%; margin-bottom: 18px; animation: msgIn 0.25s ease both; }
@keyframes msgIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: none; } }
.chat-msg.assistant { margin-right: auto; }
.chat-msg.user { margin-left: auto; flex-direction: row-reverse; }

/* Avatar circles */
.chat-msg::before {
  content: attr(data-label);
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 700;
  font-family: var(--serif); flex-shrink: 0; margin-top: 2px;
}
.chat-msg.assistant::before {
  background: var(--accent); color: #FAF8F5; content: 'G';
}
.chat-msg.user::before {
  background: var(--bg-accent); border: 1px solid var(--border);
  color: var(--text-secondary); content: 'U';
}

.chat-msg-inner { display: flex; flex-direction: column; min-width: 0; }
.chat-msg.user .chat-msg-inner { align-items: flex-end; }

.chat-bubble {
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 0.925rem;
  line-height: 1.72;
}
.chat-msg.assistant .chat-bubble {
  background: var(--chat-ai);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
  color: var(--text);
}
.chat-msg.user .chat-bubble {
  background: var(--accent); color: #FAF8F5;
  border-bottom-right-radius: 4px;
}

.chat-label {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 4px; padding: 0 2px;
}
.chat-msg.user .chat-label { text-align: right; }

.option-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.option-btn {
  font-family: var(--sans); font-size: 0.83rem;
  padding: 7px 13px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 20px;
  cursor: pointer; color: var(--text-secondary);
  transition: all 0.18s; text-align: left; line-height: 1.3;
}
.option-btn:hover { background: var(--accent); color: #FAF8F5; border-color: var(--accent); }

.chat-input-area { display: flex; gap: 10px; }

.chat-input {
  flex: 1; font-family: var(--sans); font-size: 0.93rem;
  padding: 13px 18px; border: 1px solid var(--border);
  border-radius: 28px; background: var(--bg-card);
  color: var(--text); outline: none; transition: border-color 0.18s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-light); }

.send-btn {
  font-family: var(--sans); font-size: 0.88rem; font-weight: 600;
  padding: 13px 22px; background: var(--accent);
  color: #FAF8F5; border: none; border-radius: 28px;
  cursor: pointer; transition: background 0.18s;
  white-space: nowrap; letter-spacing: 0.01em;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ═══ FEEDBACK BUTTONS ══════════════════════════════════ */

.feedback-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 0 2px;
}
.feedback-btn {
  background: none; border: 1px solid transparent;
  border-radius: 7px; padding: 4px 7px; cursor: pointer;
  font-size: 0.72rem; color: var(--text-light);
  transition: all 0.18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  min-width: 34px; min-height: 34px;
}
.feedback-btn:hover { border-color: var(--border); color: var(--text-secondary); background: var(--bg-accent); }
.feedback-btn.selected-up   { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.feedback-btn.selected-down { background: var(--red-bg);   border-color: var(--red);   color: var(--red);   }
.feedback-btn svg { width: 15px; height: 15px; }
.feedback-note { font-size: 0.7rem; color: var(--text-light); font-style: italic; }

/* ═══ APPROACH ══════════════════════════════════════════ */

.approach-section { max-width: 860px; margin: 0 auto; }
.approach-section h2 {
  font-family: var(--serif); font-size: 1.5rem;
  margin-bottom: 10px; text-align: center; letter-spacing: -0.01em;
}
.approach-section > p {
  color: var(--text-secondary); font-size: 0.97rem;
  text-align: center; max-width: 560px;
  margin: 0 auto 32px; line-height: 1.72;
}

.principle-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.principle-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  display: flex; gap: 15px;
  box-shadow: 0 1px 4px oklch(0% 0 0 / 0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}
.principle-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* Icon circle replaces emoji */
.principle-icon-circle {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: var(--serif); font-weight: 700; font-size: 0.78rem;
}
/* Hide emoji — circle used instead */
.principle-icon { display: none; }

.principle-card h3 {
  font-family: var(--serif); font-size: 1rem;
  margin-bottom: 7px; color: var(--text);
  letter-spacing: -0.01em;
}
.principle-card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.72; }

/* ═══ READING ════════════════════════════════════════════ */

.reading-list { max-width: 760px; margin: 0 auto; }
.reading-list h2 {
  font-family: var(--serif); font-size: 1.5rem;
  margin-bottom: 28px; text-align: center; letter-spacing: -0.01em;
}

.reading-tier { margin-bottom: 28px; }
.reading-tier h3 {
  font-size: 0.71rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 12px;
  padding-bottom: 9px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.tier-badge {
  background: var(--accent); color: #FAF8F5;
  font-size: 0.6rem; padding: 2px 7px; border-radius: 12px;
  letter-spacing: 0.06em;
}

.reading-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 9px; padding: 12px 16px; margin-bottom: 7px;
  font-size: 0.91rem;
  display: flex; align-items: baseline; gap: 8px;
  box-shadow: 0 1px 3px oklch(0% 0 0 / 0.04);
  transition: border-color 0.18s, transform 0.18s;
}
.reading-item:hover { border-color: var(--accent-light); transform: translateX(3px); }
.reading-item strong { font-weight: 500; }
.reading-item .author { color: var(--text-light); font-size: 0.82rem; flex-shrink: 0; }

/* ═══ FEEDBACK DASHBOARD ════════════════════════════════ */

.feedback-dashboard { max-width: 760px; margin: 0 auto; }
.feedback-dashboard h2 {
  font-family: var(--serif); font-size: 1.5rem;
  margin-bottom: 10px; text-align: center; letter-spacing: -0.01em;
}
.feedback-dashboard > p {
  color: var(--text-secondary); font-size: 0.95rem;
  text-align: center; margin-bottom: 28px;
}

.fb-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 24px;
}
.fb-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
  box-shadow: 0 1px 3px oklch(0% 0 0 / 0.04);
}
.fb-stat-card .num { font-size: 2.1rem; font-weight: 700; font-family: var(--serif); color: var(--accent); }
.fb-stat-card .label { font-size: 0.77rem; color: var(--text-light); margin-top: 4px; }

.fb-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 9px; padding: 14px 18px; margin-bottom: 9px;
}
.fb-item .fb-rating {
  font-size: 0.72rem; font-weight: 600; padding: 3px 9px;
  border-radius: 12px; display: inline-block; margin-bottom: 7px;
}
.fb-item .fb-rating.up   { background: var(--green-bg); color: var(--green); }
.fb-item .fb-rating.down { background: var(--red-bg);   color: var(--red);   }
.fb-item .fb-msg      { font-size: 0.87rem; color: var(--text-secondary); line-height: 1.6; }
.fb-item .fb-response { font-size: 0.84rem; color: var(--text-light); margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.fb-item .fb-time     { font-size: 0.7rem; color: var(--text-light); margin-top: 4px; }

.clear-fb-btn {
  font-family: var(--sans); font-size: 0.8rem; padding: 8px 16px;
  background: var(--red-bg); color: var(--red);
  border: 1px solid oklch(80% 0.06 25); border-radius: 8px;
  cursor: pointer; margin-top: 14px;
}
.export-fb-btn {
  font-family: var(--sans); font-size: 0.8rem; padding: 8px 16px;
  background: var(--green-bg); color: var(--green);
  border: 1px solid oklch(80% 0.07 155); border-radius: 8px;
  cursor: pointer; margin-top: 14px; margin-left: 8px;
}

/* ═══ TYPING INDICATOR ══════════════════════════════════ */

.typing-indicator { display: inline-flex; gap: 4px; padding: 8px 4px; }
.typing-indicator span {
  width: 6px; height: 6px; background: var(--text-light);
  border-radius: 50%; animation: typing 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%,60%,100% { transform: translateY(0); opacity: 0.35; }
  30%          { transform: translateY(-5px); opacity: 1; }
}

/* ═══ MOBILE BOTTOM TAB BAR ═════════════════════════════ */

.mobile-tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(250,248,245,0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-tabbar-inner {
  display: flex; max-width: 480px; margin: 0 auto;
}
.mobile-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 8px 4px 6px; background: none; border: none;
  cursor: pointer; font-family: var(--sans);
  color: var(--text-light); transition: color 0.18s;
}
.mobile-tab.active { color: var(--accent); }
.mobile-tab svg { width: 22px; height: 22px; stroke-width: 1.7; }
.mobile-tab span { font-size: 0.59rem; font-weight: 600; letter-spacing: 0.02em; }
.mobile-tab-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
  margin: 0 auto 1px;
  opacity: 0; transition: opacity 0.18s;
}
.mobile-tab.active .mobile-tab-dot { opacity: 1; }

/* ═══ RESPONSIVE ════════════════════════════════════════ */

@media (max-width: 640px) {
  .header-content { padding: 36px 18px 30px; }
  .pathway-grid { grid-template-columns: 1fr 1fr; }
  .principle-cards-grid { grid-template-columns: 1fr; }
  .chat-msg { max-width: 92%; }
  .fb-stats { grid-template-columns: 1fr; }
  main { padding-bottom: 80px; } /* space for mobile tabbar */

  /* Hide top nav on mobile, show bottom tabbar */
  nav { display: none; }
  .mobile-tabbar { display: block; }
}

@media (max-width: 400px) {
  .pathway-grid { grid-template-columns: 1fr; }
}
