:root {
  color-scheme: light;
  --paper: #f7f3e9;
  --surface: rgba(255, 253, 248, 0.94);
  --ink: #1f2924;
  --muted: #777a70;
  --line: rgba(72, 82, 74, 0.13);
  --green: #245f48;
  --green-dark: #194735;
  --green-soft: #dfece4;
  --red: #9b3028;
  --gold: #b18134;
  --shadow: 0 16px 45px rgba(49, 57, 51, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
}

html { scroll-behavior: smooth; }

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(180, 135, 66, 0.09), transparent 28%),
    radial-gradient(circle at 86% 78%, rgba(36, 95, 72, 0.07), transparent 30%),
    #f7f3e9;
  -webkit-font-smoothing: antialiased;
}

button,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; text-decoration: none; }

.home-page { min-height: 100vh; overflow: clip; }

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(28, 62, 51, 0.1);
  background: rgba(250, 247, 239, 0.92);
  backdrop-filter: blur(18px);
}

.site-header-inner {
  width: min(1240px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.home-brand img {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  filter: drop-shadow(0 5px 10px rgba(111, 30, 24, 0.12));
}

.home-brand span { display: grid; gap: 2px; }
.home-brand strong { font-family: "Songti SC", "STSong", serif; font-size: 18px; letter-spacing: 0.06em; }
.home-brand small { color: var(--muted); font-size: 10px; letter-spacing: 0.04em; }

.home-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.home-nav a {
  padding: 10px 13px;
  border-radius: 10px;
  color: #4f5d57;
  font-size: 13px;
  font-weight: 650;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.home-nav a:hover,
.home-nav a:focus-visible {
  color: var(--green-dark);
  background: rgba(36, 95, 72, 0.07);
}

.home-nav .nav-app {
  margin-left: 7px;
  padding-inline: 17px;
  color: #fffdf6;
  background: var(--green);
  box-shadow: 0 7px 18px rgba(36, 95, 72, 0.16);
}

.home-nav .nav-app:hover,
.home-nav .nav-app:focus-visible { color: white; background: var(--green-dark); transform: translateY(-1px); }

.home-nav .nav-account {
  margin-left: 3px;
  color: var(--red);
  border: 1px solid rgba(155, 48, 40, 0.18);
  background: rgba(255, 253, 247, 0.72);
}

.home-nav .nav-account:hover,
.home-nav .nav-account:focus-visible {
  color: #7e241e;
  background: rgba(155, 48, 40, 0.07);
}

.hero-stage {
  position: relative;
  isolation: isolate;
  min-height: 760px;
  padding: 56px 20px 70px;
  background:
    linear-gradient(90deg, rgba(250, 248, 241, 0.99) 0%, rgba(250, 248, 241, 0.94) 43%, rgba(250, 248, 241, 0.77) 70%, rgba(250, 248, 241, 0.88) 100%),
    url("/static/images/hero-v2.jpg") center bottom / cover no-repeat;
}

.hero-stage::after {
  content: "彭";
  position: absolute;
  z-index: -1;
  left: -25px;
  bottom: -54px;
  color: rgba(139, 43, 35, 0.035);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 310px;
  line-height: 1;
  pointer-events: none;
}

.hero-grid {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(390px, 0.9fr) minmax(520px, 1.1fr);
  align-items: center;
  gap: clamp(42px, 6vw, 86px);
}

.hero-copy { position: relative; z-index: 1; }

.hero-kicker {
  width: fit-content;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid rgba(155, 48, 40, 0.13);
  border-radius: 99px;
  color: #7c5e3e;
  background: rgba(255, 253, 247, 0.68);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.hero-kicker span { color: var(--red); }

.hero-copy h1 {
  margin: 24px 0 0;
  color: #18382f;
  font-family: "Iowan Old Style", "Songti SC", "STSong", serif;
  font-size: clamp(49px, 5.1vw, 72px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.055em;
}

.hero-copy h1 em { color: var(--red); font-style: normal; }

.hero-lead {
  max-width: 580px;
  margin: 22px 0 0;
  color: #5d6b65;
  font-size: 15px;
  line-height: 1.92;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-actions a {
  min-height: 50px;
  padding: 0 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.hero-actions a:hover,
.hero-actions a:focus-visible { transform: translateY(-2px); }
.hero-primary { color: #fffdf5; background: var(--red); box-shadow: 0 12px 26px rgba(155, 48, 40, 0.2); }
.hero-primary:hover,
.hero-primary:focus-visible { background: #7e241e; box-shadow: 0 15px 30px rgba(155, 48, 40, 0.25); }
.hero-secondary { border: 1px solid rgba(36, 95, 72, 0.17); color: var(--green-dark); background: rgba(255, 253, 247, 0.84); }

.home-stats {
  margin: 31px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(32, 68, 56, 0.12);
  border-bottom: 1px solid rgba(32, 68, 56, 0.12);
}

.home-stats div { padding: 16px 10px 15px; border-left: 1px solid rgba(32, 68, 56, 0.1); }
.home-stats div:first-child { padding-left: 0; border-left: 0; }
.home-stats dt { color: #173f35; font-family: "Iowan Old Style", Georgia, serif; font-size: 24px; font-weight: 700; line-height: 1; }
.home-stats dd { margin: 6px 0 0; color: #7a837e; font-size: 10px; letter-spacing: 0.08em; }

.source-promise {
  margin-top: 24px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(177, 129, 52, 0.21);
  border-radius: 14px;
  background: rgba(255, 252, 244, 0.77);
}

.source-seal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(155, 48, 40, 0.25);
  border-radius: 50%;
  color: var(--red);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 17px;
}

.source-promise p { margin: 0; color: #68716c; font-size: 10px; line-height: 1.65; }
.source-promise strong { color: #364840; font-size: 11px; }
.source-promise a { color: var(--red); font-size: 10px; font-weight: 750; white-space: nowrap; }

.chat-card {
  position: relative;
  z-index: 2;
  padding: 11px;
  border: 1px solid rgba(36, 95, 72, 0.14);
  border-radius: 29px;
  background: rgba(255, 253, 248, 0.64);
  box-shadow: 0 32px 85px rgba(31, 57, 47, 0.16), 0 0 0 7px rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
}

.chat-card-label {
  width: fit-content;
  margin: -34px 16px 11px auto;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 99px;
  color: #6b756f;
  background: rgba(255, 253, 248, 0.82);
  font-size: 10px;
  font-weight: 650;
}

.chat-card-label span { width: 6px; height: 6px; border-radius: 50%; background: #3f9b68; box-shadow: 0 0 0 3px rgba(63, 155, 104, 0.12); }

.ai-gate {
  min-height: 620px;
  padding: clamp(38px, 6vw, 62px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 18%, rgba(177, 129, 52, 0.14), transparent 31%),
    linear-gradient(155deg, rgba(255, 253, 247, 0.95), rgba(239, 238, 228, 0.88));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.ai-gate-orbit {
  width: 106px;
  height: 106px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(177, 129, 52, 0.24);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(177, 129, 52, 0.045), 0 0 0 38px rgba(36, 95, 72, 0.025);
}

.ai-gate-orbit span {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #fffaf0;
  background: linear-gradient(145deg, #194735, #2b7057);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 31px;
  box-shadow: 0 14px 28px rgba(25, 71, 53, 0.22);
}

.ai-gate-kicker {
  margin: 42px 0 0;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.ai-gate h2 {
  max-width: 420px;
  margin: 13px 0 0;
  color: #18382f;
  font-family: "Iowan Old Style", "Songti SC", serif;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.28;
}

.ai-gate-lead {
  max-width: 430px;
  margin: 16px 0 0;
  color: #66736d;
  font-size: 13px;
  line-height: 1.8;
}

.ai-gate ul {
  width: min(100%, 440px);
  margin: 25px 0 27px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
}

.ai-gate li {
  padding: 13px 7px;
  display: grid;
  place-items: center;
  gap: 7px;
  border: 1px solid rgba(36, 95, 72, 0.11);
  border-radius: 13px;
  color: #65716c;
  background: rgba(255, 253, 248, 0.72);
  font-size: 10px;
}

.ai-gate li span {
  color: var(--red);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 19px;
}

.ai-gate-primary {
  width: min(100%, 360px);
  min-height: 50px;
  padding: 0 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 13px;
  color: #fffdf5;
  background: var(--red);
  font-size: 14px;
  font-weight: 760;
  box-shadow: 0 12px 26px rgba(155, 48, 40, 0.2);
}

.ai-gate-primary:hover,
.ai-gate-primary:focus-visible { background: #7e241e; transform: translateY(-1px); }
.ai-gate-primary b { font-size: 20px; font-weight: 500; }
.ai-gate-secondary { margin-top: 13px; color: var(--green); font-size: 12px; font-weight: 720; }
.ai-gate small { margin-top: 14px; color: #8b928e; font-size: 10px; }

.home-section { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.journey-section { padding: 92px 0 82px; }

.section-heading { max-width: 660px; margin-bottom: 32px; }
.section-heading p,
.app-callout-copy > p { margin: 0 0 9px; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.section-heading h2,
.app-callout-copy h2 { margin: 0; font-family: "Iowan Old Style", "Songti SC", serif; font-size: clamp(30px, 4vw, 44px); font-weight: 650; line-height: 1.25; letter-spacing: -0.035em; }

.journey-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.journey-card {
  position: relative;
  min-height: 270px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(45, 66, 57, 0.11);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.76);
  box-shadow: 0 10px 30px rgba(42, 58, 51, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.journey-card:hover,
.journey-card:focus-visible { transform: translateY(-4px); border-color: rgba(36, 95, 72, 0.27); box-shadow: 0 18px 40px rgba(42, 58, 51, 0.08); }
.journey-card > span { position: absolute; top: 23px; right: 24px; color: rgba(23, 63, 53, 0.18); font-family: Georgia, serif; font-size: 14px; }
.journey-card i { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; color: var(--red); background: rgba(155, 48, 40, 0.07); font-family: "STKaiti", "KaiTi", serif; font-size: 18px; font-style: normal; }
.journey-card h3 { margin: 25px 0 0; font-size: 19px; }
.journey-card p { margin: 10px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.journey-card b { margin-top: auto; color: var(--green); font-size: 12px; }

.app-callout {
  min-height: 330px;
  margin-bottom: 86px;
  padding: clamp(34px, 5vw, 60px);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 50px;
  overflow: hidden;
  border-radius: 28px;
  color: #fffaf0;
  background:
    radial-gradient(circle at 88% 10%, rgba(231, 188, 95, 0.24), transparent 25%),
    linear-gradient(135deg, #143c32, #205c4d 70%, #18473b);
  box-shadow: 0 28px 70px rgba(18, 55, 45, 0.18);
}

.app-callout-copy > p { color: #e6be69; }
.app-callout-copy h2 { max-width: 650px; }
.app-callout-copy ul { margin: 22px 0 26px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.app-callout-copy li { padding: 7px 10px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 99px; color: rgba(255, 250, 240, 0.72); background: rgba(255,255,255,.05); font-size: 11px; }
.app-callout-copy a { width: fit-content; min-height: 48px; padding: 0 18px; display: inline-flex; align-items: center; gap: 20px; border-radius: 12px; color: #64221e; background: #f2cc7c; font-size: 13px; font-weight: 800; box-shadow: 0 10px 25px rgba(7, 29, 23, 0.2); }

.app-callout-visual { position: relative; min-height: 190px; display: grid; place-items: center; }
.app-callout-visual::before { content: ""; position: absolute; width: 310px; height: 310px; border: 1px solid rgba(239, 202, 124, .18); border-radius: 50%; box-shadow: 0 0 0 38px rgba(239, 202, 124, .035), 0 0 0 80px rgba(239, 202, 124, .025); }
.app-callout-visual img { position: relative; z-index: 1; width: 112px; height: 112px; border-radius: 26px; filter: drop-shadow(0 20px 26px rgba(4, 22, 17, 0.28)); }
.app-callout-visual div { position: absolute; z-index: 2; right: 0; bottom: 6px; width: 210px; padding: 13px 15px; display: grid; gap: 3px; border: 1px solid rgba(255,255,255,.19); border-radius: 14px; background: rgba(7, 32, 25, .52); backdrop-filter: blur(11px); }
.app-callout-visual strong { font-size: 13px; }
.app-callout-visual span { color: rgba(255, 250, 240, .6); font-size: 10px; }

.home-footer {
  padding: 38px max(20px, calc((100% - 1180px) / 2)) 30px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 40px;
  border-top: 1px solid rgba(42, 62, 54, 0.12);
  color: #68746f;
  background: rgba(235, 236, 228, 0.72);
}

.footer-brand { color: #1a4438; font-family: "Songti SC", "STSong", serif; font-size: 18px; font-weight: 700; }
.home-footer p { margin: 5px 0 0; font-size: 11px; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; font-size: 11px; }
.footer-links a:hover { color: var(--red); }
.footer-record { grid-column: 1 / -1; padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(42, 62, 54, 0.09); color: #88908c; font-size: 10px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-app {
  width: 100%;
  height: min(680px, calc(100dvh - 110px));
  min-height: 590px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(250, 247, 239, 0.72);
  border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65), var(--shadow);
  position: relative;
  overflow: hidden;
}

.chat-topbar {
  min-height: 66px;
  padding: max(7px, env(safe-area-inset-top)) 16px 7px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 239, 0.9);
  backdrop-filter: blur(18px);
  z-index: 3;
}

.chat-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.15;
}

.chat-title strong {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.chat-title span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.chat-title i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3f9b68;
  box-shadow: 0 0 0 3px rgba(63, 155, 104, 0.12);
}

.icon-button,
.composer-button {
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  background: transparent;
  border-radius: 50%;
}

.icon-button {
  width: 42px;
  height: 42px;
}

.icon-button:hover { background: rgba(36, 95, 72, 0.07); }

.icon-button svg,
.composer-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-stream {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 18px clamp(16px, 5vw, 58px) 26px;
  scroll-behavior: smooth;
}

.chat-stream::before {
  content: "彭";
  position: absolute;
  inset: auto 50% 9%;
  transform: translateX(50%);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: min(42vw, 340px);
  line-height: 1;
  color: rgba(36, 95, 72, 0.025);
  pointer-events: none;
}

.chat-day {
  width: fit-content;
  margin: 0 auto 24px;
  padding: 4px 10px;
  color: #8b8b80;
  background: rgba(105, 105, 95, 0.06);
  border-radius: 99px;
  font-size: 11px;
}

.message {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0 auto 20px;
  max-width: 760px;
  animation: message-in 220ms ease both;
}

.message-user { justify-content: flex-end; }

.message-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: min(82%, 610px);
}

.message-user .message-column { align-items: flex-end; }

.assistant-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff8e8;
  background: var(--green);
  border: 1px solid rgba(180, 135, 66, 0.55);
  border-radius: 50%;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(36, 95, 72, 0.16);
}

.message-bubble {
  padding: 12px 15px;
  border-radius: 18px 18px 18px 5px;
  background: var(--surface);
  border: 1px solid rgba(72, 82, 74, 0.09);
  box-shadow: 0 5px 18px rgba(49, 57, 51, 0.05);
  font-size: 15px;
  line-height: 1.68;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-user .message-bubble {
  color: #f9fff9;
  background: var(--green);
  border-color: var(--green);
  border-radius: 18px 18px 5px 18px;
  box-shadow: 0 6px 18px rgba(36, 95, 72, 0.16);
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quick-replies button {
  padding: 8px 12px;
  border: 1px solid rgba(36, 95, 72, 0.2);
  border-radius: 99px;
  color: var(--green-dark);
  background: rgba(255, 253, 248, 0.76);
  cursor: pointer;
  font-size: 13px;
  transition: 150ms ease;
}

.quick-replies button:hover {
  border-color: rgba(36, 95, 72, 0.48);
  background: var(--green-soft);
}

.quick-replies.is-disabled { opacity: 0.5; }
.quick-replies.is-disabled button { pointer-events: none; }

.typing-bubble {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 45px;
}

.typing-bubble i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7f8b84;
  animation: typing 900ms infinite ease-in-out;
}

.typing-bubble i:nth-child(2) { animation-delay: 120ms; }
.typing-bubble i:nth-child(3) { animation-delay: 240ms; }

.person-results {
  width: min(100%, 520px);
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.person-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: 150ms ease;
}

.person-card:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 95, 72, 0.28);
}

.person-card strong { font-size: 15px; }
.person-card span { color: var(--muted); font-size: 12px; }
.person-card b { grid-row: 1 / 3; grid-column: 2; color: var(--green); font-weight: 500; }

.result-all {
  width: fit-content;
  margin: 4px 0 0 4px;
  color: var(--green);
  font-size: 13px;
  text-underline-offset: 3px;
}

.mini-lineage {
  width: min(100%, 540px);
  margin-top: 12px;
  padding: 13px;
  border: 1px solid rgba(180, 135, 66, 0.32);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(247, 242, 230, 0.92));
  box-shadow: 0 8px 22px rgba(82, 68, 43, 0.06);
}

.mini-lineage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 11px;
}

.mini-lineage-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mini-lineage-head strong {
  color: #9a342d;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.mini-lineage-head span {
  max-width: 330px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-lineage-head > a {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 11px;
  text-decoration: none;
}

.mini-lineage-tier {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.mini-lineage-node {
  min-width: 0;
  width: min(31%, 142px);
  min-height: 50px;
  padding: 7px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  border: 1px solid rgba(72, 82, 74, 0.14);
  border-radius: 11px;
  background: rgba(239, 238, 230, 0.72);
}

.mini-lineage-node:hover {
  border-color: rgba(36, 95, 72, 0.34);
  background: rgba(223, 236, 228, 0.74);
}

.mini-lineage-node strong {
  max-width: 100%;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.mini-lineage-node span {
  color: var(--muted);
  font-size: 9px;
}

.mini-lineage-node.is-subject {
  border-color: rgba(154, 52, 45, 0.4);
  background: rgba(235, 217, 201, 0.72);
  box-shadow: 0 4px 12px rgba(154, 52, 45, 0.07);
}

.mini-lineage-node.is-subject strong {
  color: #7f2d28;
  font-weight: 700;
}

.mini-lineage-node.is-empty {
  color: #99988d;
  border-style: dashed;
  background: rgba(242, 240, 233, 0.46);
}

.mini-lineage-connector {
  position: relative;
  width: 68%;
  height: 27px;
  margin: 0 auto;
}

.mini-lineage-connector::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(180, 135, 66, 0.7);
}

.mini-lineage-connector::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 0;
  left: 0;
  height: 1px;
  background: rgba(180, 135, 66, 0.7);
}

.mini-lineage-connector.is-down::after { top: 19px; }

.mini-lineage-tier.is-parents .mini-lineage-node::after,
.mini-lineage-tier.is-children .mini-lineage-node::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  height: 9px;
  background: rgba(180, 135, 66, 0.7);
}

.mini-lineage-tier.is-parents .mini-lineage-node,
.mini-lineage-tier.is-children .mini-lineage-node {
  position: relative;
}

.mini-lineage-tier.is-parents .mini-lineage-node::after {
  bottom: -9px;
}

.mini-lineage-tier.is-children .mini-lineage-node::before {
  top: -9px;
}

.mini-lineage-note {
  margin: 8px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.app-card {
  width: min(100%, 540px);
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(36, 95, 72, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(223, 236, 228, 0.9), rgba(255, 253, 248, 0.92));
}

.app-card img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.app-card div { min-width: 0; display: grid; gap: 3px; }
.app-card strong { font-size: 14px; }
.app-card span { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-card a {
  padding: 8px 13px;
  border-radius: 99px;
  color: white;
  background: var(--green);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.chat-composer-wrap {
  position: relative;
  z-index: 3;
  padding: 4px clamp(12px, 3vw, 28px) max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(250, 247, 239, 0.94);
  backdrop-filter: blur(18px);
}

.chat-hint {
  margin: 0 0 4px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.chat-composer {
  max-width: 760px;
  min-height: 54px;
  margin: 0 auto;
  padding: 6px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  border: 1px solid rgba(72, 82, 74, 0.14);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 8px 28px rgba(49, 57, 51, 0.08);
}

.chat-composer:focus-within {
  border-color: rgba(36, 95, 72, 0.36);
  box-shadow: 0 8px 28px rgba(49, 57, 51, 0.08), 0 0 0 3px rgba(36, 95, 72, 0.06);
}

.chat-composer textarea {
  min-width: 0;
  flex: 1;
  min-height: 40px;
  max-height: 94px;
  padding: 9px 7px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  line-height: 1.45;
  font-size: 15px;
}

.chat-composer textarea::placeholder { color: #9a9b92; }

.composer-button {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  color: var(--green);
  background: rgba(36, 95, 72, 0.07);
}

.composer-button:hover { background: rgba(36, 95, 72, 0.12); }

.send-button {
  color: white;
  background: var(--green);
}

.send-button:hover { background: var(--green-dark); }
.send-button:disabled { color: #a1a79f; background: #ecece6; cursor: default; }

/* Person details stay inside the conversation so chat context is never replaced. */
.pcard-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.pcard-modal[hidden] { display: none; }

.pcard-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 31, 27, 0.52);
  backdrop-filter: blur(7px);
  animation: modal-fade 160ms ease both;
}

.pcard-modal-shell {
  position: relative;
  width: min(820px, calc(100vw - 32px));
  max-height: min(780px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(180, 135, 66, 0.28);
  border-radius: 22px;
  background: linear-gradient(180deg, #fffdf7, #f7f1e5);
  box-shadow: 0 28px 80px rgba(20, 31, 27, 0.3);
  animation: modal-rise 190ms cubic-bezier(0.2, 0.82, 0.3, 1) both;
}

.pcard-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(31, 41, 36, 0.08);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.pcard-modal-close:hover { background: rgba(154, 52, 45, 0.12); }
.pcard-modal-close:focus-visible { outline: 3px solid rgba(36, 95, 72, 0.24); outline-offset: 2px; }

.pcard-modal-stack {
  min-height: 0;
  padding: 14px 62px 0 22px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.pcard-modal-stack:empty { padding: 0; }

.pcard-crumb {
  padding: 5px 9px;
  border: 0;
  border-radius: 99px;
  color: var(--green-dark);
  background: rgba(36, 95, 72, 0.09);
  cursor: pointer;
  font-size: 11px;
}

.pcard-crumb.current { color: #7f2d28; background: rgba(154, 52, 45, 0.1); cursor: default; }
.pcard-crumb-sep { color: #a49c8f; font-size: 12px; }

.pcard-modal-body {
  min-height: 220px;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 62px 30px 28px;
}

.pcard-loading {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
}

.pcard-loading.is-error { color: #8b3730; }

.pcard-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(36, 95, 72, 0.18);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: pcard-spin 700ms linear infinite;
}

.pcard { display: grid; gap: 16px; }

.pcard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 8px 15px 0;
  border-bottom: 1px solid rgba(180, 135, 66, 0.2);
}

.pcard-head h2 {
  margin: 4px 0 5px;
  color: #7f2d28;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 28px;
  line-height: 1.2;
}

.pcard-head p { margin: 0; }
.pcard-head-actions { flex: 0 0 auto; }
.section-kicker { color: #9a342d; font-size: 11px; letter-spacing: 0.1em; }
.muted { color: var(--muted); }

.button-link {
  min-height: 38px;
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(36, 95, 72, 0.18);
  border-radius: 10px;
  color: var(--green-dark);
  background: rgba(255, 253, 248, 0.86);
  text-decoration: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.button-link:hover { border-color: rgba(36, 95, 72, 0.42); background: var(--green-soft); }
.button-link.block { width: 100%; }

.alias-block,
.alias-block.compact,
.image-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.alias-pill {
  padding: 6px 10px;
  border-radius: 99px;
  color: #7f2d28;
  background: rgba(154, 52, 45, 0.08);
  font-size: 12px;
}

.pcard-hero,
.pcard-entry-snippet {
  overflow: hidden;
  border: 1px solid rgba(72, 82, 74, 0.12);
  border-radius: 13px;
  background: #fffdf8;
}

.pcard-hero img,
.pcard-entry-snippet img {
  width: 100%;
  max-height: 260px;
  display: block;
  object-fit: cover;
}

.pcard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pcard-rel,
.pcard-intro,
.pcard-entry {
  padding: 12px 14px;
  border: 1px solid rgba(72, 82, 74, 0.11);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.76);
}

.pcard-rel h4,
.pcard-section h4 {
  margin: 0 0 8px;
  color: #7f2d28;
  font-size: 13px;
}

.pcard-rel p { margin: 0; font-size: 13px; }

.pcard-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.pcard-list li { font-size: 14px; line-height: 1.6; }
.pcard-list a { color: var(--green-dark); text-underline-offset: 3px; }

.pcard-section,
.pcard-entries { display: grid; gap: 10px; }

.pcard-section-head,
.pcard-entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.pcard-entry-meta { justify-content: flex-start; color: var(--muted); font-size: 11px; }
.pcard-entry-meta a { color: var(--green); }
.pcard-entry .small { margin: 7px 0 0; font-size: 12px; }

.pcard-entry-text,
.pcard-intro-text,
.text-flow {
  color: #39433e;
  font-size: 13px;
  line-height: 1.85;
}

.text-flow p { margin: 0; }
.text-flow p + p { margin-top: 0.8em; }

/* Five-turn App upgrade prompt. Premium visual language, explicitly free. */
.upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
}

.upgrade-modal[hidden] { display: none; }

.upgrade-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 22, 18, 0.7);
  backdrop-filter: blur(10px) saturate(0.8);
  animation: modal-fade 180ms ease both;
}

.upgrade-modal-shell {
  position: relative;
  width: min(940px, calc(100vw - 32px));
  max-height: min(900px, calc(100dvh - 44px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(218, 175, 91, 0.38);
  border-radius: 28px;
  background: #fbf8f0;
  box-shadow: 0 38px 110px rgba(5, 17, 13, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.28) inset;
  animation: upgrade-rise 240ms cubic-bezier(0.18, 0.84, 0.28, 1) both;
}

.upgrade-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 0 0 3px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: #fff9e9;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.upgrade-modal-close:hover { background: rgba(255, 255, 255, 0.2); }
.upgrade-modal-close:focus-visible { outline: 3px solid rgba(242, 203, 119, 0.58); outline-offset: 2px; }

.upgrade-modal-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.upgrade-hero {
  position: relative;
  min-height: 330px;
  padding: 34px clamp(26px, 5vw, 54px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
  align-items: center;
  gap: 34px;
  overflow: hidden;
  color: #fffaf0;
  background:
    radial-gradient(circle at 76% 7%, rgba(232, 190, 104, 0.28), transparent 27%),
    radial-gradient(circle at 12% 100%, rgba(139, 50, 40, 0.32), transparent 35%),
    linear-gradient(135deg, #102f29 0%, #1d5648 62%, #123a31 100%);
}

.upgrade-hero::after {
  content: "彭";
  position: absolute;
  right: 30%;
  bottom: -82px;
  color: rgba(255, 249, 231, 0.035);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 300px;
  line-height: 1;
  pointer-events: none;
}

.upgrade-copy,
.upgrade-qr-card { position: relative; z-index: 1; }

.upgrade-brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
}

.upgrade-brand-row img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18));
}

.upgrade-brand-row div { display: grid; gap: 2px; }
.upgrade-brand-row strong { font-size: 14px; letter-spacing: 0.02em; }
.upgrade-brand-row span { color: rgba(255, 250, 240, 0.65); font-size: 10px; letter-spacing: 0.12em; }

.upgrade-eyebrow {
  width: fit-content;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(235, 197, 113, 0.32);
  border-radius: 99px;
  color: #f2cf84;
  background: rgba(235, 197, 113, 0.08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.upgrade-copy h2 {
  margin: 15px 0 0;
  font-family: "Iowan Old Style", "Songti SC", "STSong", serif;
  font-size: clamp(35px, 5vw, 55px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.upgrade-copy h2 em { color: #f0ca78; font-style: normal; }

.upgrade-lead {
  max-width: 570px;
  margin: 15px 0 0;
  color: rgba(255, 250, 240, 0.73);
  font-size: 13px;
  line-height: 1.75;
}

.upgrade-price {
  width: fit-content;
  min-width: 270px;
  margin-top: 21px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(240, 202, 120, 0.28);
  border-radius: 15px;
  background: rgba(7, 27, 22, 0.3);
}

.upgrade-price > span { color: #f0ca78; font-size: 11px; font-weight: 700; }
.upgrade-price strong { font-size: 36px; line-height: 1; }
.upgrade-price strong small { margin-right: 2px; font-size: 16px; }
.upgrade-price p { margin: 0; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.16); color: rgba(255, 250, 240, 0.63); font-size: 10px; line-height: 1.55; }

.upgrade-qr-card {
  width: min(245px, 100%);
  justify-self: end;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 23px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.97);
  box-shadow: 0 24px 52px rgba(3, 19, 14, 0.32);
  text-align: center;
}

.upgrade-qr-badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 99px;
  color: #8d302a;
  background: rgba(154, 52, 45, 0.08);
  font-size: 10px;
  font-weight: 700;
}

.upgrade-qr-card a { display: block; }

.upgrade-qr-card img {
  width: 178px;
  max-width: 100%;
  aspect-ratio: 1;
  display: block;
  margin: 10px auto 7px;
  border-radius: 12px;
  image-rendering: pixelated;
  -webkit-touch-callout: default;
  user-select: auto;
}

.upgrade-qr-card > strong { color: var(--green-dark); font-size: 14px; }
.upgrade-qr-card > p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

.upgrade-benefits,
.upgrade-compare { padding: 27px clamp(22px, 5vw, 48px); }

.upgrade-compare { padding-top: 0; }

.upgrade-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.upgrade-section-head div { display: grid; gap: 3px; }
.upgrade-section-head span { color: #9a342d; font-size: 10px; font-weight: 750; letter-spacing: 0.12em; }
.upgrade-section-head h3 { margin: 0; font-size: 20px; }
.upgrade-section-head > b { padding: 6px 10px; border-radius: 99px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; }

.upgrade-benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.upgrade-benefit-grid article {
  min-width: 0;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid rgba(72, 82, 74, 0.11);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.84);
}

.upgrade-benefit-grid i {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #8d302a;
  background: rgba(154, 52, 45, 0.08);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.upgrade-benefit-grid div { min-width: 0; display: grid; gap: 3px; }
.upgrade-benefit-grid strong { font-size: 12px; }
.upgrade-benefit-grid span { color: var(--muted); font-size: 10px; line-height: 1.55; }

.upgrade-compare-table {
  overflow: hidden;
  border: 1px solid rgba(72, 82, 74, 0.12);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.86);
}

.upgrade-compare-row {
  min-height: 42px;
  padding: 8px 14px;
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(110px, 0.8fr) minmax(120px, 0.85fr);
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(72, 82, 74, 0.08);
  font-size: 11px;
}

.upgrade-compare-row:first-child { border-top: 0; }
.upgrade-compare-row strong { font-weight: 600; }
.upgrade-compare-row span { color: var(--muted); }
.upgrade-compare-row b { width: fit-content; padding: 4px 8px; border-radius: 99px; color: var(--green-dark); background: rgba(36, 95, 72, 0.09); font-size: 10px; }
.upgrade-compare-row.is-head { min-height: 38px; color: rgba(255, 250, 240, 0.88); background: var(--green-dark); }
.upgrade-compare-row.is-head span { color: rgba(255, 250, 240, 0.65); }

.upgrade-modal-footer {
  position: relative;
  z-index: 2;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto minmax(300px, 520px);
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  border-top: 1px solid rgba(72, 82, 74, 0.12);
  background: rgba(251, 248, 240, 0.96);
  backdrop-filter: blur(14px);
}

.upgrade-later {
  min-height: 50px;
  padding: 0 16px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.upgrade-primary {
  min-height: 54px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 15px;
  color: #fff9ec;
  background: linear-gradient(135deg, #9a342d, #77231f);
  box-shadow: 0 10px 24px rgba(119, 35, 31, 0.23);
  text-decoration: none;
}

.upgrade-primary span { font-size: 14px; font-weight: 800; }
.upgrade-primary b { color: #f0ca78; font-size: 11px; }
.upgrade-modal-footer small { grid-column: 1 / -1; color: #8c918b; text-align: center; font-size: 9px; letter-spacing: 0.04em; }

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pcard-spin { to { transform: rotate(360deg); } }
@keyframes upgrade-rise { from { opacity: 0; transform: translateY(20px) scale(0.965); } to { opacity: 1; transform: none; } }

@keyframes message-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 1040px) {
  .hero-stage { padding-top: 50px; }
  .hero-grid { grid-template-columns: minmax(330px, 0.82fr) minmax(470px, 1.18fr); gap: 34px; }
  .hero-copy h1 { font-size: clamp(46px, 5.7vw, 61px); }
  .source-promise { grid-template-columns: 38px 1fr; }
  .source-promise a { grid-column: 2; }
}

@media (max-width: 860px) {
  .site-header-inner { width: min(100% - 28px, 720px); }
  .home-nav a:not(.nav-app):not(.nav-account) { display: none; }
  .hero-stage {
    padding: 48px 16px 60px;
    background:
      linear-gradient(180deg, rgba(250, 248, 241, 0.97) 0%, rgba(250, 248, 241, 0.91) 46%, rgba(250, 248, 241, 0.88) 100%),
      url("/static/images/hero-v2.jpg") center bottom / cover no-repeat;
  }
  .hero-grid { max-width: 720px; grid-template-columns: minmax(0, 1fr); gap: 65px; }
  .hero-grid > * { min-width: 0; }
  .hero-copy { max-width: 650px; }
  .hero-copy h1 { font-size: clamp(52px, 10vw, 70px); }
  .chat-card { width: 100%; }
  .chat-app { height: min(720px, calc(100dvh - 34px)); min-height: 620px; }
  .journey-grid { grid-template-columns: 1fr; }
  .journey-card { min-height: 210px; }
  .app-callout { grid-template-columns: 1fr; }
  .app-callout-visual { min-height: 230px; }
  .home-footer { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .footer-record { grid-column: 1; flex-direction: column; }
}

@media (max-width: 600px) {
  .site-header-inner { min-height: 64px; }
  .home-brand { gap: 8px; }
  .home-brand img { width: 39px; height: 39px; border-radius: 11px; }
  .home-brand strong { font-size: 16px; }
  .home-brand small { font-size: 8px; }
  .home-nav .nav-app { margin: 0; padding: 9px 12px; font-size: 11px; }
  .home-nav .nav-account { margin: 0; padding: 9px 12px; font-size: 11px; }
  .hero-stage { padding: 38px 10px 50px; }
  .hero-copy { padding: 0 7px; }
  .hero-kicker { font-size: 9px; }
  .hero-copy h1 { margin-top: 18px; font-size: clamp(44px, 14vw, 61px); line-height: 1.13; }
  .hero-lead { margin-top: 17px; font-size: 13px; line-height: 1.85; }
  .hero-actions { margin-top: 22px; }
  .hero-actions a { min-height: 47px; padding: 0 15px; gap: 13px; font-size: 12px; }
  .home-stats { margin-top: 25px; }
  .home-stats div { padding: 14px 8px; }
  .home-stats dt { font-size: 21px; }
  .home-stats dd { font-size: 9px; }
  .source-promise { margin-top: 19px; padding: 11px; }
  .source-promise p { font-size: 9px; }
  .chat-card { padding: 5px; border-radius: 22px; box-shadow: 0 22px 58px rgba(31, 57, 47, 0.16), 0 0 0 3px rgba(255,255,255,.32); }
  .chat-card-label { margin: -33px 7px 10px auto; }
  .ai-gate { min-height: 520px; padding: 40px 22px 34px; }
  .ai-gate ul { gap: 5px; }
  .ai-gate li { padding-inline: 4px; }
  .chat-app { width: 100%; height: min(690px, calc(100dvh - 20px)); min-height: 590px; border-radius: 18px; box-shadow: none; }
  .chat-topbar { min-height: 58px; padding-inline: 10px; }
  .chat-stream { padding: 15px 12px 18px; }
  .chat-day { margin-bottom: 18px; }
  .message { gap: 8px; margin-bottom: 17px; }
  .message-column { max-width: calc(100% - 44px); }
  .assistant-avatar { width: 32px; height: 32px; }
  .message-bubble { padding: 11px 13px; font-size: 14px; }
  .quick-replies { display: grid; width: 100%; }
  .quick-replies button { text-align: left; }
  .chat-composer-wrap { padding-inline: 8px; }
  .chat-hint { display: none; }
  .chat-composer { border-radius: 18px; }
  .composer-button { width: 38px; height: 38px; }
  .app-card { grid-template-columns: 40px 1fr auto; gap: 9px; }
  .app-card img { width: 40px; height: 40px; }
  .app-card a { padding-inline: 11px; }
  .mini-lineage { padding: 11px 9px; }
  .mini-lineage-head { gap: 8px; }
  .mini-lineage-head span { max-width: 200px; }
  .mini-lineage-node { width: min(32%, 112px); min-height: 48px; padding-inline: 3px; }
  .mini-lineage-node strong { font-size: 11px; }
  .pcard-modal { place-items: end center; padding: 0; }
  .pcard-modal-shell {
    width: 100%;
    max-height: 88dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }
  .pcard-modal-stack { padding: 14px 56px 0 16px; }
  .pcard-modal-body { padding: 22px 16px max(24px, env(safe-area-inset-bottom)); }
  .pcard-head { flex-direction: column; padding-right: 42px; }
  .pcard-head h2 { font-size: 25px; }
  .pcard-grid { grid-template-columns: 1fr; }
  .upgrade-modal { place-items: end center; padding: 0; }
  .upgrade-modal-shell {
    width: 100%;
    max-height: 94dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }
  .upgrade-hero { min-height: 0; padding: 28px 17px 25px; grid-template-columns: 1fr; gap: 24px; }
  .upgrade-brand-row { margin-bottom: 18px; }
  .upgrade-copy h2 { font-size: 38px; }
  .upgrade-price { min-width: 0; width: 100%; }
  .upgrade-qr-card { width: min(280px, 100%); justify-self: center; }
  .upgrade-qr-card img { width: 170px; }
  .upgrade-benefits,
  .upgrade-compare { padding-right: 14px; padding-left: 14px; }
  .upgrade-benefit-grid { grid-template-columns: 1fr; }
  .upgrade-section-head > b { display: none; }
  .upgrade-compare-row { padding-inline: 10px; grid-template-columns: minmax(120px, 1.25fr) minmax(74px, 0.78fr) minmax(88px, 0.85fr); gap: 7px; font-size: 10px; }
  .upgrade-modal-footer { grid-template-columns: 1fr; padding-inline: 10px; }
  .upgrade-primary { grid-row: 1; }
  .upgrade-later { grid-row: 2; min-height: 40px; }
  .upgrade-modal-footer small { grid-row: 3; }
  .home-section { width: calc(100% - 28px); }
  .journey-section { padding: 64px 0 56px; }
  .section-heading { margin-bottom: 22px; }
  .section-heading h2,
  .app-callout-copy h2 { font-size: 30px; }
  .journey-card { min-height: 215px; padding: 21px; }
  .app-callout { width: calc(100% - 20px); margin-bottom: 56px; padding: 29px 20px 23px; gap: 25px; border-radius: 22px; }
  .app-callout-copy ul { display: grid; }
  .app-callout-visual { min-height: 190px; }
  .app-callout-visual::before { width: 230px; height: 230px; }
  .app-callout-visual img { width: 94px; height: 94px; }
  .app-callout-visual div { right: 0; width: 190px; }
  .home-footer { padding: 30px 20px 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; }
}

/* Keep the embedded chat inside very narrow browser panels.  The landing-page
   redesign places this stylesheet inside a one-column hero grid; without
   explicit zero minimums, the topbar's intrinsic width can grow the 320px
   viewport to a 360px grid track and clip the right-side controls. */
@media (max-width: 600px) {
  .hero-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-grid > *,
  .chat-card,
  .chat-app,
  .chat-topbar,
  .chat-stream,
  .chat-composer-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .chat-card,
  .chat-app { width: 100%; }

  .chat-topbar { grid-template-columns: 42px minmax(0, 1fr) 42px; }
  .chat-title { min-width: 0; }
}
