:root {
  --bg: #f4f1ea;
  --ink: #5C574E;
  --accent: #A8682E;
  --accent-soft: #c79a6a;
  --card: #fffdf8;
  --line: #e4ddcf;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Montserrat", "Noto Serif SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--accent); }
[hidden] { display: none !important; }
.tiny { font-size: 12px; opacity: 0.7; }

/* topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: var(--card);
}
.brand { font-weight: 700; letter-spacing: 0.5px; }
.brand span { color: var(--accent); }
.topbar nav a { margin-left: 18px; text-decoration: none; font-size: 14px; }
.lang-sep { opacity: 0.35; margin: 0 1px; }
.topbar nav a.lang { color: var(--ink); opacity: 0.5; font-weight: 600; }
.topbar nav a.lang.active { color: var(--accent); opacity: 1; }

/* hero */
.hero { max-width: 720px; margin: 60px auto; text-align: center; padding: 0 20px; }
.hero h1 { font-size: 34px; line-height: 1.25; margin-bottom: 14px; }
.hero .sub { font-size: 16px; opacity: 0.8; margin-bottom: 26px; }
.primary {
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 12px 26px; font-size: 15px; cursor: pointer; font-weight: 600;
}
.primary:hover { background: #8f5724; }
.ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; cursor: pointer; font-size: 13px;
}
.ghost.small { padding: 5px 12px; font-size: 12px; }
.hero .tiny { margin-top: 14px; }

/* system */
.system { max-width: 920px; margin: 40px auto; padding: 0 20px; }
.system h2 { text-align: center; font-size: 26px; }
.sys-sub { text-align: center; opacity: 0.75; margin-bottom: 26px; }
.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.pillar {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px;
}
.pillar h3 { margin: 0 0 6px; color: var(--accent); font-size: 17px; }
.pillar .desc { margin: 0 0 12px; font-size: 14px; }
.pillar .preview {
  background: var(--bg); border-radius: 10px; padding: 10px 12px;
  font-size: 13px; font-style: italic; opacity: 0.85;
}
.pillar .lock {
  margin-top: 12px; font-size: 12.5px; opacity: 0.7;
  border-top: 1px dashed var(--line); padding-top: 10px;
}
.pillar .lock.unlocked { opacity: 1; color: var(--accent); font-weight: 600; }

/* chat */
.chat { max-width: 680px; margin: 30px auto; padding: 0 16px; }
.chat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.timer { font-size: 14px; opacity: 0.7; }
.plus-badge {
  background: var(--accent); color: #fff; font-size: 11px; padding: 2px 10px;
  border-radius: 999px; font-weight: 600;
}
.messages { min-height: 240px; max-height: 52vh; overflow-y: auto; padding: 8px 4px; }
.msg { margin: 10px 0; padding: 10px 14px; border-radius: 14px; max-width: 82%; }
.msg.user { background: var(--accent); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.msg.bot { background: var(--card); border: 1px solid var(--line); margin-right: auto; border-bottom-left-radius: 4px; }
.msg.thinking { opacity: 0.6; font-style: italic; }
.crisis {
  background: #fbeede; border: 1px solid var(--accent-soft); border-radius: 12px;
  padding: 12px 14px; margin: 10px 0; font-size: 14px;
}
.crisis a { font-weight: 600; }
.composer { display: flex; gap: 10px; align-items: flex-end; margin-top: 8px; }
.composer textarea {
  flex: 1; resize: none; min-height: 46px; max-height: 120px; border-radius: 12px;
  border: 1px solid var(--line); padding: 12px; font-family: inherit; font-size: 14px;
  background: var(--card); color: var(--ink);
}

/* memory bar */
.mem-bar {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; opacity: 0.8; margin: 8px 2px;
}

/* upsell */
.upsell {
  margin-top: 18px; background: var(--card); border: 1px solid var(--accent-soft);
  border-radius: 16px; padding: 22px; text-align: center;
}
.upsell h3 { margin: 0 0 6px; color: var(--accent); }
.upsell-lead { opacity: 0.75; margin: 0 0 14px; font-size: 14px; }
.gap { list-style: none; padding: 0; margin: 0 auto 18px; max-width: 460px; text-align: left; }
.gap li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.gap li b { color: var(--accent); }

/* report card */
.report-card {
  margin-top: 16px; background: var(--bg); border-radius: 12px; padding: 16px;
  white-space: pre-wrap; text-align: left; font-size: 13.5px;
}
.rc-theme { font-weight: 700; color: var(--accent); margin-bottom: 6px; }

/* footer */
.foot { max-width: 720px; margin: 60px auto 40px; padding: 0 20px; text-align: center; font-size: 12.5px; opacity: 0.65; }
.foot p { margin: 6px 0; }

@media (max-width: 640px) {
  .pillars { grid-template-columns: 1fr; }
  .hero h1 { font-size: 27px; }
}
