/* ===== Rebuild With Claude — styles ===== */
:root {
  --bg: #faf7f2;
  --bg-card: #ffffff;
  --ink: #1f1b16;
  --ink-soft: #5c5448;
  --ink-faint: #8a8175;
  --line: #e7e0d4;
  --line-strong: #d8cfbe;
  --accent: #d9663f;        /* Claude clay, richer */
  --accent-deep: #b54a28;
  --accent-soft: #fbe7dd;
  --accent2: #2f9e8f;       /* teal pop */
  --accent2-soft: #e1f2ef;
  --gold: #e9a23a;
  --grad-warm: linear-gradient(135deg, #e8895f 0%, #d9663f 55%, #bd4f2b 100%);
  --grad-warm-soft: linear-gradient(135deg, #fff1e8 0%, #fbe2d4 100%);
  --hero-grad: radial-gradient(1100px 520px at 12% -15%, #ffe4d3 0%, rgba(255,228,211,0) 60%), radial-gradient(900px 500px at 100% 0%, #e3f3f0 0%, rgba(227,243,240,0) 55%), linear-gradient(180deg,#fdf5ee 0%, #faf7f2 70%);
  --good: #2f9e6b;
  --good-soft: #e3f3ea;
  --warn-soft: #fdf3e1;
  --warn-line: #efd6a6;
  --info-soft: #eaf1f8;
  --info-line: #c7d8ec;
  --shadow: 0 1px 2px rgba(31,27,22,.04), 0 8px 24px rgba(31,27,22,.06);
  --shadow-lg: 0 12px 40px rgba(31,27,22,.12);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 290px;
  --maxw: 760px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  background-image: var(--hero-grad);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Top scroll progress ===== */
.progress-rail {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: transparent; z-index: 100;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  transition: width .1s linear;
}

/* ===== Layout ===== */
.layout { display: flex; align-items: flex-start; }

.sidebar {
  position: sticky; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  flex: 0 0 var(--sidebar-w);
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: #fbf9f4;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 26px; }
.brand-mark {
  line-height: 1;
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  background: var(--grad-warm); color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(181,74,40,.28);
}
/* Claude-style spark mark */
.cspark { width: 60%; height: 60%; display: block; }
.brand-mark .cspark { width: 24px; height: 24px; }
.brand-title { font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.15; }
.brand-sub { font-size: 12px; color: var(--ink-faint); }

.course-progress {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 22px;
}
.course-progress-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.course-progress-head span:last-child { color: var(--accent-deep); }
.course-progress-rail { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; }
.course-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--good), #56a578); border-radius: 99px; transition: width .4s ease; }
.course-progress-note { font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; }

.outline { display: flex; flex-direction: column; gap: 2px; }
.outline-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  color: var(--ink-soft); font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.outline-link:hover { background: var(--accent-soft); text-decoration: none; color: var(--ink); }
.outline-link.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.outline-link .num {
  width: 22px; height: 22px; flex: 0 0 22px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  border-radius: 7px; background: var(--line); color: var(--ink-soft);
}
.outline-link.active .num, .outline-link.done .num { background: var(--accent); color: #fff; }
.outline-link.done .num::after { content: "✓"; }
.outline-link.done .num { font-size: 0; }
.outline-link.done .num::after { font-size: 13px; }
.outline-link .dot { width: 8px; height: 8px; flex: 0 0 8px; margin: 0 7px; border-radius: 99px; background: var(--line-strong); }
.outline-link.done .dot { background: var(--good); }

.reset-btn {
  margin-top: auto; padding-top: 18px;
  background: none; border: none; color: var(--ink-faint);
  font-size: 12px; cursor: pointer; text-align: left; font-family: var(--sans);
}
.reset-btn:hover { color: var(--accent-deep); text-decoration: underline; }

/* ===== Content ===== */
.content {
  flex: 1 1 auto; min-width: 0;
  padding: 0 7vw 80px;
}
.hero, .band, .lesson { max-width: var(--maxw); margin: 0 auto; }

/* Hero */
.hero { padding: 80px 0 56px; }
.hero-eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: #fff; background: var(--grad-warm);
  padding: 6px 14px; border-radius: 99px; margin-bottom: 22px;
  box-shadow: 0 4px 12px rgba(181,74,40,.25);
}
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(34px, 6vw, 56px); line-height: 1.05;
  letter-spacing: -.01em; margin: 0 0 24px;
}
.lede { font-size: clamp(17px, 2.1vw, 19px); color: var(--ink-soft); margin: 0 0 18px; }
.lede strong { color: var(--ink); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 26px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px 26px; font-size: 14px; color: var(--ink-faint); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 13px 22px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--grad-warm); color: #fff; box-shadow: 0 6px 18px rgba(181,74,40,.32); }
.btn-primary:hover { filter: brightness(1.04); color: #fff; box-shadow: 0 10px 28px rgba(181,74,40,.4); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: #fff; color: var(--ink); }

/* Bands (full-bleed soft sections) */
.band {
  padding: 48px 0; margin-top: 18px;
}
.band-title { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 28px; }
.band-lede { font-size: 18px; color: var(--ink-soft); margin: 0 0 24px; }
.band-foot { font-size: 16px; color: var(--ink-soft); margin-top: 26px; font-style: italic; }
.band-finish { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.cards-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.mini-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px;
}
.mini-card .mini-icon { font-size: 22px; margin-bottom: 8px; }
.mini-card h3 { font-family: var(--serif); font-weight: 600; font-size: 16px; margin: 0 0 6px; }
.mini-card p { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* Promo: install the AI coach */
.promo {
  max-width: var(--maxw); margin: 0 auto;
  background: var(--grad-warm); color: #fff;
  border-radius: var(--radius); padding: 34px 32px;
  box-shadow: 0 14px 40px rgba(181,74,40,.35);
}
.promo-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255,255,255,.2); padding: 6px 12px; border-radius: 99px; margin-bottom: 16px;
}
.promo-badge .cspark { width: 16px; height: 16px; }
.promo h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 12px; color: #fff; }
.promo > p { font-size: 16px; color: rgba(255,255,255,.92); margin: 0 0 20px; }
.promo > p strong { color: #fff; }
.promo-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.promo-step { display: flex; align-items: flex-start; gap: 12px; font-size: 15.5px; color: #fff; }
.promo-step code { background: rgba(255,255,255,.18); color: #fff; }
.promo-step a { color: #fff; font-weight: 700; text-decoration: underline; }
.ps-num { flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center; background: #fff; color: var(--accent-deep); font-weight: 700; font-size: 13px; border-radius: 8px; }
.promo-fine { font-size: 13px; color: rgba(255,255,255,.8); margin: 0; }

/* Lesson sections */
.lesson { padding: 56px 0; border-top: 1px solid var(--line); }
.lesson-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.lesson-badge {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--grad-warm); padding: 5px 11px; border-radius: 7px; white-space: nowrap;
  box-shadow: 0 3px 9px rgba(181,74,40,.25);
}
.lesson-head h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 4vw, 38px); line-height: 1.1; margin: 0; }
.lesson-goal { font-size: 17px; color: var(--ink-soft); margin: 0 0 8px; }
.lesson > p { font-size: 16px; color: var(--ink-soft); }

.sub {
  font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-faint); margin: 36px 0 14px;
}

/* Ideas */
.idea {
  background: var(--bg-card); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 12px 0;
}
.idea h4 { font-family: var(--serif); font-weight: 600; font-size: 17px; margin: 0 0 6px; }
.idea p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.idea ul, .idea ol { margin: 10px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: 15.5px; }
.idea li { margin-bottom: 6px; }
ol.loop { counter-reset: loop; list-style: none; padding-left: 0; }
ol.loop li { position: relative; padding-left: 34px; margin-bottom: 8px; }
ol.loop li::before {
  counter-increment: loop; content: counter(loop);
  position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-deep);
  font-weight: 700; font-size: 12px; border-radius: 6px;
}

/* Task lists (interactive) */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li { margin: 0 0 8px; }
.task-list label {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 15px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.task-list label:hover { border-color: var(--line-strong); }
.task-list input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--good); flex: 0 0 18px; cursor: pointer; }
.task-list span { font-size: 15.5px; color: var(--ink); }
.task-list input:checked + span { color: var(--ink-faint); text-decoration: line-through; }

/* Code & prompts (copyable) */
.code, .prompt {
  position: relative;
  background: var(--bg-card); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); margin: 12px 0;
}
.code { padding: 14px 92px 14px 16px; }
.code code {
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 14.5px; color: var(--ink); word-break: break-all;
}
.prompt { padding: 16px 92px 16px 18px; background: var(--accent-soft); border-color: #eccab9; }
.prompt p { margin: 0; font-size: 15.5px; color: #6a3a27; }
.copy-btn {
  position: absolute; top: 11px; right: 11px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  background: var(--ink); color: #fff; border: none;
  padding: 7px 13px; border-radius: 7px; cursor: pointer; transition: background .15s;
}
.copy-btn:hover { background: var(--accent-deep); }
.copy-btn.copied { background: var(--good); }
code { font-family: "SF Mono", Menlo, Consolas, monospace; background: #f0ebe1; padding: 1px 6px; border-radius: 5px; font-size: .9em; }

/* Callouts */
.callout { border-radius: var(--radius-sm); padding: 16px 18px; margin: 14px 0; font-size: 15.5px; }
.callout ul { margin: 0; padding-left: 20px; }
.callout li { margin-bottom: 6px; color: var(--ink-soft); }
.callout-info { background: var(--info-soft); border: 1px solid var(--info-line); color: var(--ink-soft); }
.callout-info strong { color: var(--ink); }
.callout-warn { background: var(--warn-soft); border: 1px solid var(--warn-line); }

/* Tabs (install) */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.tab {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--line-strong); color: var(--ink-soft);
  padding: 10px 15px; border-radius: 9px; cursor: pointer; transition: all .15s;
}
.tab:hover { border-color: var(--accent); color: var(--ink); }
.tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-panel { display: none; animation: fade .25s ease; }
.tab-panel.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tab-panel p { font-size: 15.5px; color: var(--ink-soft); }
.dl-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.fine { font-size: 13.5px; color: var(--ink-faint); }

/* Video */
.video {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; margin: 14px 0;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  background: #000;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Checkpoint */
.checkpoint {
  display: flex; align-items: center; gap: 16px;
  background: var(--good-soft); border: 1px solid #c6e3d1;
  border-radius: var(--radius); padding: 18px 20px; margin: 30px 0 0;
}
.checkpoint-mark { font-size: 26px; flex: 0 0 auto; }
.checkpoint-body { flex: 1 1 auto; }
.checkpoint-body strong { font-family: var(--serif); font-size: 16px; }
.checkpoint-body p { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-soft); }
.checkpoint-btn {
  flex: 0 0 auto; font-family: var(--sans); font-weight: 600; font-size: 14px;
  background: var(--good); color: #fff; border: none;
  padding: 11px 18px; border-radius: 9px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.checkpoint-btn:hover { background: #347a52; }
.checkpoint.done { background: #fff; border-color: var(--line); }
.checkpoint.done .checkpoint-btn { background: var(--line); color: var(--ink-soft); }
.checkpoint.done .checkpoint-btn::before { content: "✓ "; }

/* Reference table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.ref-table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--bg-card); }
.ref-table th, .ref-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ref-table thead th { background: #f3ede2; font-family: var(--sans); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }
.ref-table tbody tr:last-child td { border-bottom: none; }
.ref-table td { color: var(--ink-soft); }

.final-cta {
  text-align: center; background: var(--accent-soft);
  border: 1px solid #eccab9; border-radius: var(--radius);
  padding: 36px 24px; margin-top: 34px;
}
.final-cta h3 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0 0 8px; }
.final-cta p { color: var(--ink-soft); margin: 0 0 20px; }

/* Footer */
.site-footer { max-width: var(--maxw); margin: 60px auto 0; padding-top: 28px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 14px; }
.footer-fine { font-size: 12.5px; margin-top: 8px; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 99px;
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 200; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Auto-generated learner tips (self-learning) ===== */
.learner-tips {
  background: var(--info-soft); border: 1px solid var(--info-line);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0;
}
.learner-tips-head { font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.learner-tips ul { margin: 0; padding-left: 20px; }
.learner-tips li { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 4px; }

/* ===== Popular questions (live FAQ) ===== */
.badge-live { background: var(--good); display: inline-flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 99px; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 70% { box-shadow: 0 0 0 6px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 15px 18px;
  font-family: var(--serif); font-weight: 600; font-size: 16px; color: var(--ink);
  display: flex; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; margin-left: auto; color: var(--accent-deep); font-size: 20px; font-weight: 400; transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { background: var(--accent-soft); }
.faq-ans { padding: 0 18px 16px; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.faq-count { font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--accent-deep); background: var(--accent-soft); padding: 3px 8px; border-radius: 99px; }

/* ===== Chat help agent ===== */
.chat-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 150;
  display: flex; align-items: center; gap: 10px;
  background: var(--grad-warm); color: #fff; border: none;
  padding: 14px 22px 14px 16px; border-radius: 99px; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 15.5px;
  box-shadow: 0 10px 28px rgba(181,74,40,.45); transition: transform .15s, box-shadow .15s, filter .15s;
  animation: fabPop 5s ease-in-out 1s infinite;
}
.chat-fab:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 14px 34px rgba(181,74,40,.55); animation: none; }
.chat-fab.hidden { display: none; }
.chat-fab-label strong { font-weight: 700; }
.chat-fab-icon {
  width: 30px; height: 30px; flex: 0 0 30px; line-height: 1;
  display: grid; place-items: center;
  background: rgba(255,255,255,.22); border-radius: 50%;
}
.chat-fab-icon .cspark { width: 19px; height: 19px; }
@keyframes fabPop { 0%, 92%, 100% { transform: translateY(0) scale(1); } 96% { transform: translateY(-3px) scale(1.04); } }
.chat-avatar .cspark { width: 22px; height: 22px; }

/* "This site teaches itself" hero note */
.self-update-note {
  display: flex; align-items: flex-start; gap: 11px;
  margin-top: 26px; padding: 14px 18px; border-radius: 12px;
  background: var(--grad-warm-soft); border: 1px solid #f1d3c4;
  font-size: 14.5px; color: #7a3f29; max-width: 640px;
}
.self-update-note .su-text { flex: 1; }
.site-cost { margin-top: 12px; font-size: 13.5px; color: var(--ink-faint); }
.site-cost strong { color: var(--ink-soft); }
.self-update-note strong { color: #9c4a2c; }
.self-update-note a { color: var(--accent-deep); font-weight: 700; white-space: nowrap; }
.su-dot { width: 9px; height: 9px; flex: 0 0 9px; margin-top: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(217,102,63,.6); animation: pulse 1.8s infinite; }

.chat-window {
  position: fixed; bottom: 22px; right: 22px; z-index: 151;
  width: min(390px, calc(100vw - 32px));
  height: min(580px, calc(100vh - 44px));
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; overflow: hidden;
}
.chat-window.open { display: flex; animation: chatIn .2s ease; }
@keyframes chatIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--accent); color: #fff;
}
.chat-header-id { display: flex; align-items: center; gap: 11px; }
.chat-avatar {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  background: rgba(255,255,255,.18); border-radius: 11px; font-size: 20px;
}
.chat-title { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.1; }
.chat-status { font-size: 12px; opacity: .85; }
.chat-close { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; opacity: .85; padding: 4px; }
.chat-close:hover { opacity: 1; }

.chat-log { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.msg { max-width: 86%; font-size: 14.5px; line-height: 1.55; padding: 11px 14px; border-radius: 15px; }
.msg p { margin: 0 0 8px; }
.msg p:last-child { margin: 0; }
.msg code { background: rgba(31,27,22,.08); }
.msg.bot { align-self: flex-start; background: var(--bg-card); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 5px; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.msg.user a { color: #fff; }
.msg.bot a { color: var(--accent-deep); font-weight: 600; }
.msg .copy-mini {
  display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600;
  background: var(--ink); color: #fff; border: none; padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.msg.typing { color: var(--ink-faint); font-style: italic; }
.typing-dots span { display: inline-block; width: 6px; height: 6px; margin: 0 1px; background: var(--ink-faint); border-radius: 99px; animation: blink 1.2s infinite both; }
.typing-dots span:nth-child(2){ animation-delay: .2s; } .typing-dots span:nth-child(3){ animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{ opacity:.2; } 40%{ opacity:1; } }

.chat-cost { padding: 8px 14px; background: var(--bg); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-faint); text-align: center; }
.chat-cost strong { color: var(--ink-soft); }

.outline-chat { width: 100%; text-align: left; background: none; border: none; cursor: pointer; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--accent-deep); margin-top: 4px; }
.outline-chat:hover { background: var(--accent-soft); }

.chat-quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 14px 4px; background: var(--bg); }
.chat-quick button {
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--line-strong); color: var(--ink-soft);
  padding: 7px 12px; border-radius: 99px; cursor: pointer; transition: all .15s;
}
.chat-quick button:hover { border-color: var(--accent); color: var(--accent-deep); }

.chat-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--bg-card); }
.chat-input input {
  flex: 1 1 auto; font-family: var(--sans); font-size: 14.5px;
  border: 1px solid var(--line-strong); border-radius: 99px; padding: 11px 16px; outline: none; background: var(--bg);
}
.chat-input input:focus { border-color: var(--accent); }
.chat-input button {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; font-size: 15px; cursor: pointer; transition: background .15s;
}
.chat-input button:hover { background: var(--accent-deep); }

@media (max-width: 860px) {
  .chat-window { bottom: 0; right: 0; width: 100vw; height: 100vh; border-radius: 0; }
  .chat-fab-label { display: none; }
  .chat-fab { padding: 14px; }
}

/* Mobile bar + menu */
.mobile-bar { display: none; }
.scrim { display: none; }

@media (max-width: 860px) {
  .mobile-bar {
    display: flex; align-items: center; gap: 14px;
    position: sticky; top: 0; z-index: 90;
    background: rgba(251,249,244,.92); backdrop-filter: blur(8px);
    padding: 12px 18px; border-bottom: 1px solid var(--line);
  }
  .menu-toggle { background: none; border: none; cursor: pointer; padding: 4px; display: grid; gap: 5px; }
  .menu-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
  .mobile-title { font-family: var(--serif); font-weight: 600; flex: 1 1 auto; }
  .mobile-progress { font-size: 13px; font-weight: 700; color: var(--accent-deep); }

  .layout { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 95;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(31,27,22,.4); z-index: 92; }

  .content { padding: 0 22px 60px; }
  .hero { padding: 44px 0 36px; }
  .cards-4, .cards-2 { grid-template-columns: 1fr; }
  .checkpoint { flex-wrap: wrap; }
  .checkpoint-btn { width: 100%; }
}

/* ===== Mood / color themes ===== */
html[data-theme="happy"] {
  --accent:#ef9f2e; --accent-deep:#cf7d16; --accent-soft:#fdedcf;
  --grad-warm:linear-gradient(135deg,#ffc24d 0%,#ef9f2e 55%,#df7d12 100%);
  --grad-warm-soft:linear-gradient(135deg,#fff6e1,#ffe8bd);
  --hero-grad: radial-gradient(1100px 520px at 12% -15%,#fff0c6 0%,rgba(255,240,198,0) 60%), radial-gradient(900px 500px at 100% 0%,#d9eeff 0%,rgba(217,238,255,0) 55%), linear-gradient(180deg,#fffaf0 0%,#faf7f2 70%);
}
html[data-theme="dancing"] {
  --accent:#b25cff; --accent-deep:#8a35e0; --accent-soft:#f1e4ff;
  --grad-warm:linear-gradient(135deg,#ff6ec7 0%,#b25cff 55%,#6a5cff 100%);
  --grad-warm-soft:linear-gradient(135deg,#fbe9ff,#e9ecff);
  --hero-grad: radial-gradient(1100px 520px at 12% -15%,#ffe0f4 0%,rgba(255,224,244,0) 60%), radial-gradient(900px 500px at 100% 0%,#d9f5ef 0%,rgba(217,245,239,0) 55%), linear-gradient(180deg,#fdf7ff 0%,#f8f7fb 70%);
  --bg:#faf7fb;
}
html[data-theme="serious"] {
  --accent:#3f6079; --accent-deep:#2c465c; --accent-soft:#e7edf3;
  --grad-warm:linear-gradient(135deg,#4d6e89 0%,#3f6079 55%,#2c465c 100%);
  --grad-warm-soft:linear-gradient(135deg,#eef2f6,#e2e9f0);
  --hero-grad: radial-gradient(1000px 520px at 12% -15%,#e9eef4 0%,rgba(233,238,244,0) 60%), linear-gradient(180deg,#f7f8fa 0%,#f4f5f7 70%);
  --bg:#f6f7f9;
}

/* Theme picker control */
.theme-picker { position: fixed; top: 14px; right: 16px; z-index: 160; }
.theme-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-card); box-shadow: var(--shadow); cursor: pointer;
  font-size: 20px; line-height: 1; display: grid; place-items: center; transition: transform .15s;
}
.theme-btn:hover { transform: scale(1.08) rotate(-6deg); }
.theme-menu {
  position: absolute; top: 50px; right: 0; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 190px; display: flex; flex-direction: column; gap: 2px;
}
.theme-menu[hidden] { display: none; }
.theme-menu-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); padding: 6px 12px 4px; }
.theme-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; padding: 9px 12px; border-radius: 8px; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink);
}
.theme-menu button:hover { background: var(--accent-soft); }
.theme-menu button span { font-size: 18px; }
@media (max-width: 860px) { .theme-picker { top: 9px; right: 12px; } .mobile-progress { display: none; } }

/* ===== First-visit welcome modal ===== */
.welcome-overlay{position:fixed;inset:0;z-index:300;background:rgba(31,27,22,.5);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;padding:20px;animation:fade .25s ease;}
.welcome-overlay[hidden]{display:none;}
.welcome-card{position:relative;background:var(--bg-card);border:1px solid var(--line);border-radius:18px;max-width:480px;width:100%;padding:34px;box-shadow:var(--shadow-lg);animation:chatIn .25s ease;}
.welcome-close{position:absolute;top:14px;right:14px;background:none;border:none;font-size:16px;color:var(--ink-faint);cursor:pointer;line-height:1;}
.welcome-close:hover{color:var(--accent-deep);}
.welcome-spark{width:50px;height:50px;border-radius:14px;background:var(--grad-warm);display:grid;place-items:center;margin-bottom:18px;box-shadow:0 6px 16px rgba(181,74,40,.28);}
.welcome-spark .cspark{width:27px;height:27px;}
.welcome-card h2{font-family:var(--serif);font-weight:600;font-size:25px;margin:0 0 12px;}
.welcome-card p{font-size:15.5px;color:var(--ink-soft);margin:0 0 12px;line-height:1.55;}
.welcome-card p strong{color:var(--ink);}
.welcome-btn{margin-top:8px;}

/* welcome modal vibe selector */
.welcome-vibe-label{font-family:var(--sans);font-weight:700;font-size:12px;letter-spacing:.05em;text-transform:uppercase;color:var(--ink-faint);margin:6px 0 10px !important;}
.welcome-vibes{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:16px;}
.welcome-vibes button{display:flex;align-items:center;gap:8px;font-family:var(--sans);font-size:14px;font-weight:600;color:var(--ink);background:var(--bg);border:1px solid var(--line-strong);border-radius:10px;padding:10px 12px;cursor:pointer;transition:border-color .15s,background .15s;}
.welcome-vibes button span{font-size:17px;}
.welcome-vibes button:hover{border-color:var(--accent);}
.welcome-vibes button.active{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-deep);}
.welcome-credit{font-size:12px;color:var(--ink-faint);margin:14px 0 0 !important;}
