:root {
  --paper: #f3eee3;
  --paper-deep: #e6dcc8;
  --ink: #171815;
  --muted: #625f56;
  --red: #a63c2f;
  --red-dark: #77291f;
  --jade: #3f6755;
  --brass: #9c7628;
  --line: #c9bfa9;
  --white: #fffdf8;
  --charcoal: #20211d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.6;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-header {
  min-height: 82px;
  padding: 12px clamp(20px, 4vw, 68px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--charcoal);
  color: var(--white);
  border-bottom: 1px solid #423f36;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-seal {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid #c85140;
  color: #df6d5a;
  font: 700 23px "Songti SC", "STSong", serif;
}
.brand b { display: block; font-size: 19px; letter-spacing: 0; }
.brand small { display: block; color: #bdb6a8; font-size: 11px; line-height: 1.2; text-transform: uppercase; letter-spacing: 1.4px; }
.site-header nav { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 34px); }
.site-header nav a { color: #d7d1c4; text-decoration: none; font-size: 14px; }
.site-header nav a:hover, .site-header nav a:focus-visible { color: var(--white); }
.site-header .account-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #615e54;
}
.nav-chat { padding: 5px 0; color: #e3bc63; background: none; border: 0; border-bottom: 1px solid #88703b; font-size: 14px; }
.nav-chat:hover, .nav-chat:focus-visible { color: #ffe09a; }
.nav-install { padding: 5px 0; color: #d7d1c4; background: none; border: 0; border-bottom: 1px solid #615e54; font-size: 14px; }
.nav-install:hover, .nav-install:focus-visible { color: var(--white); border-color: #b7a46d; }
.lang-link { padding: 6px 10px; border: 1px solid #615e54; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.hero {
  position: relative;
  min-height: calc(100svh - 82px);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
  align-items: center;
  padding: clamp(50px, 7vw, 106px) clamp(22px, 7vw, 120px) 92px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: "";
  position: absolute;
  left: clamp(22px, 7vw, 120px);
  right: clamp(22px, 7vw, 120px);
  bottom: 58px;
  height: 1px;
  background: var(--line);
}
.hero-copy { position: relative; z-index: 3; max-width: 690px; grid-column: 1; grid-row: 1; }
.hero h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(46px, 6.2vw, 92px);
  line-height: .98;
  font-weight: 500;
  letter-spacing: 0;
}
.lede { max-width: 620px; margin: 24px 0 30px; color: var(--muted); font-size: clamp(18px, 1.6vw, 24px); line-height: 1.55; }
.source-line { display: flex; align-items: baseline; gap: 12px; max-width: 620px; margin: -12px 0 26px; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 15px; line-height: 1.5; }
.source-line strong { flex: 0 0 auto; color: var(--ink); font-family: var(--sans); font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }

.hero-art {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  min-height: 650px;
  margin: -30px -3vw -40px -40px;
  overflow: hidden;
}
.hero-art::before {
  content: "紫微斗数";
  position: absolute;
  top: 12%;
  right: 4%;
  color: rgba(23, 24, 21, .055);
  font: 700 clamp(80px, 9vw, 150px) "Songti SC", "STSong", serif;
  writing-mode: vertical-rl;
  letter-spacing: 12px;
}
.hero-art img {
  position: absolute;
  z-index: 2;
  inset: 1% 0 0 5%;
  width: 94%;
  height: 97%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 22px 22px rgba(27, 23, 17, .2));
  transition: opacity .2s ease;
}
.orbit { position: absolute; border: 1px solid rgba(156, 118, 40, .35); border-radius: 50%; }
.orbit-one { width: 500px; height: 500px; right: 1%; top: 18%; }
.orbit-two { width: 350px; height: 620px; right: 8%; top: 9%; transform: rotate(42deg); }
.hero-star-label {
  position: absolute;
  z-index: 4;
  right: 5%;
  bottom: 6%;
  margin: 0;
  padding: 12px 18px;
  color: var(--white);
  background: var(--charcoal);
  border-left: 4px solid var(--red);
}
.hero-star-label span { display: block; font-size: 21px; font-weight: 700; }
.hero-star-label small { display: block; color: #c9c2b2; font-size: 13px; }

.birth-form {
  max-width: 820px;
  display: grid;
  grid-template-columns: .92fr .82fr 1.45fr;
  gap: 14px;
  align-items: end;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.field label, .gender-field legend {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.field input, .field select {
  width: 100%;
  min-height: 52px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 16px;
}
.field input:focus, .field select:focus { outline: 2px solid rgba(166, 60, 47, .28); border-color: var(--red); }
.gender-field { grid-column: 1 / 2; margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; }
.gender-field legend { grid-column: 1 / -1; }
.gender-field label { margin: 0; }
.gender-field input { position: absolute; opacity: 0; pointer-events: none; }
.gender-field span {
  min-height: 52px;
  display: grid;
  place-items: center;
  background: #ece4d4;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}
.gender-field label + label span { border-left: 0; }
.gender-field input:checked + span { color: var(--white); background: var(--jade); border-color: var(--jade); }
.primary-action, .secondary-action {
  min-height: 54px;
  border-radius: 2px;
  font-weight: 700;
  font-size: 16px;
}
.primary-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border: 1px solid var(--red-dark);
  color: var(--white);
  background: var(--red);
}
.primary-action:hover, .primary-action:focus-visible { background: var(--red-dark); }
.primary-action:disabled, .secondary-action:disabled { opacity: .5; cursor: wait; }
.birth-form .primary-action { grid-column: 1 / -1; margin-top: 4px; }
.relationship-entry {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 4px;
  color: var(--red-dark);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  text-decoration: none;
}
.relationship-entry strong { color: var(--ink); font-size: 16px; }
.relationship-entry:hover, .relationship-entry:focus-visible { border-color: var(--red); }
.field-place { min-width: 0; }
.custom-location {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: .8fr 1.4fr;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--line);
}
.custom-location[hidden] { display: none; }
.solar-explainer {
  grid-column: 2 / -1;
  min-height: 52px;
  margin: 0;
  padding: 8px 0 8px 14px;
  color: var(--muted);
  border-left: 2px solid var(--gold);
  font-size: 13px;
  line-height: 1.45;
}
.solar-explainer strong, .solar-explainer span { display: block; }
.solar-explainer strong { color: var(--ink); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.form-note { grid-column: 1 / -1; margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.form-error { grid-column: 1 / -1; min-height: 1.5em; margin: 0; color: var(--red-dark); font-size: 14px; }
.solar-result { max-width: 760px; margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.next-cue { position: absolute; z-index: 3; bottom: 20px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }

.archetype-strip { padding: 88px clamp(20px, 6vw, 100px) 100px; background: var(--white); border-bottom: 1px solid var(--line); }
.section-heading { max-width: 850px; margin-bottom: 30px; }
.section-heading h2, .about h2, .result-header h2 { margin: 0; font-size: clamp(34px, 4vw, 58px); line-height: 1.08; font-weight: 500; }
.section-heading > p:last-child { max-width: 720px; color: var(--muted); font-size: 18px; }
.star-rail { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 10px; }
.star-tile {
  position: relative;
  height: 230px;
  overflow: hidden;
  padding: 0;
  background: #e9e2d4;
  border: 1px solid var(--line);
  border-radius: 3px;
  text-align: left;
}
.star-tile img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .2s ease; }
.star-tile::after { content: ""; position: absolute; inset: auto 0 0; height: 42%; background: linear-gradient(transparent, rgba(20, 20, 17, .9)); }
.star-tile span { position: absolute; z-index: 2; left: 10px; right: 8px; bottom: 9px; color: var(--white); font-size: 14px; line-height: 1.15; }
.star-tile small { display: block; color: #d4ccbd; font-size: 11px; }
.star-tile:hover img, .star-tile:focus-visible img { transform: scale(1.04); }
.star-tile.active { outline: 3px solid var(--red); outline-offset: -3px; }
.archetype-preview { display: grid; grid-template-columns: .7fr 1.5fr 1fr; gap: 24px; align-items: start; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.preview-kicker { color: var(--red); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; }
.archetype-preview strong { font-size: 20px; font-weight: 500; line-height: 1.45; }
.archetype-preview > span:last-child { color: var(--muted); font-size: 15px; }

.result { padding: 72px clamp(20px, 6vw, 100px) 100px; background: #e8dfce; }
.result-header { max-width: 1320px; display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 auto 34px; }
.text-action { padding: 8px 0; color: var(--red-dark); background: none; border: 0; border-bottom: 1px solid var(--red-dark); font-size: 14px; }
.result-layout { max-width: 1320px; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(360px, .92fr); gap: clamp(36px, 4vw, 60px); align-items: start; margin: 0 auto; }
.share-card-panel { min-width: 0; }
.card-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.language-button { min-width: 88px; padding: 7px 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 2px; font-size: 13px; }
.language-button.active { color: var(--white); background: var(--jade); border-color: var(--jade); }
.card-preview { position: relative; aspect-ratio: 4 / 5; min-height: 0; display: grid; place-items: center; background: var(--white); border: 1px solid var(--line); }
.card-preview img { display: block; width: 100%; height: auto; }
.card-loading { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.card-loading span { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.secondary-action { padding: 12px 18px; color: var(--ink); background: transparent; border: 1px solid var(--ink); }
.reading-panel { min-width: 0; padding-top: 40px; }
.reading-star { margin: 0 0 8px; color: var(--red); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; }
.reading-panel h3 { max-width: 600px; margin: 0 0 18px; font-size: clamp(34px, 3.2vw, 52px); line-height: 1.06; font-weight: 500; }
.reading-intro { max-width: 600px; margin: 0 0 30px; color: var(--muted); font-size: 18px; }
.reading-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.reading-columns span { display: block; margin-bottom: 12px; color: var(--jade); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }
.reading-columns ul { margin: 0; padding-left: 20px; }
.reading-columns li { margin-bottom: 9px; }
.blind-spot { padding-left: 24px; border-left: 3px solid var(--red); }
.blind-spot span { color: var(--red); }
.blind-spot p { margin: 0; }
.reading-note { margin-top: 34px; color: var(--muted); font-size: 13px; }
.ask-ai-action {
  width: 100%; min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 24px; padding: 14px 18px; color: var(--white); background: var(--charcoal);
  border: 1px solid var(--charcoal); border-left: 5px solid var(--brass); text-align: left;
}
.ask-ai-action:hover, .ask-ai-action:focus-visible { background: #30312b; }
.ask-ai-action > span:first-child { font-size: 18px; font-weight: 700; }
.ask-ai-action small { display: block; margin-bottom: 2px; color: #d7b563; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; }
.ask-ai-action > span:last-child { font-size: 24px; }
.chart-details { max-width: 1320px; margin: 70px auto 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chart-details summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 0; cursor: pointer; font-size: 18px; font-weight: 700; }
.chart-details summary span { padding: 3px 8px; color: var(--white); background: var(--jade); font-size: 11px; text-transform: uppercase; }
.chart-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; padding-bottom: 24px; background: var(--line); }
.palace { min-height: 150px; padding: 16px; background: var(--white); }
.palace h4 { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 8px; color: var(--red-dark); font-size: 16px; }
.palace h4 small { color: var(--muted); font-weight: 400; }
.palace p { margin: 0; font-size: 14px; line-height: 1.65; }
.palace .minor { margin-top: 6px; color: var(--muted); font-size: 12px; }

.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; padding: 100px clamp(20px, 7vw, 120px); color: var(--white); background: var(--charcoal); }
.about .eyebrow { color: #df6d5a; }
.steps { border-top: 1px solid #4a493f; }
.steps article { display: grid; grid-template-columns: 60px 180px 1fr; gap: 20px; padding: 25px 0; border-bottom: 1px solid #4a493f; }
.steps article > span { color: #c9a450; font-size: 13px; }
.steps h3 { margin: 0; font-size: 20px; }
.steps p { margin: 0; color: #c4beb1; font-size: 16px; }
.trust { display: flex; justify-content: space-between; gap: 30px; padding: 24px clamp(20px, 7vw, 120px); color: var(--muted); background: var(--white); font-size: 15px; line-height: 1.55; border-bottom: 1px solid var(--line); }
.trust p { margin: 0; }
footer { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 30px; padding: 36px clamp(20px, 4vw, 68px); color: var(--white); background: #12130f; }
footer p { margin: 0; color: #a9a397; font-size: 14px; }
footer > a:last-child { color: #d7d1c4; font-size: 14px; }

.ai-chat {
  width: min(540px, 100vw); max-width: none; height: 100dvh; max-height: none;
  margin: 0 0 0 auto; padding: 0; color: var(--ink); background: var(--paper);
  border: 0; border-left: 1px solid #57584f;
}
.ai-chat[open] { animation: chat-in .22s ease-out; }
.ai-chat::backdrop { background: rgba(18, 19, 15, .58); backdrop-filter: blur(3px); }
@keyframes chat-in { from { transform: translateX(35px); opacity: 0; } }
.ai-chat-shell { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; }
.ai-chat-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 25px 26px 20px; color: var(--white); background: var(--charcoal); border-bottom: 3px solid var(--red); }
.ai-chat-header .eyebrow { margin-bottom: 4px; color: #df6d5a; }
.ai-chat-header h2 { margin: 0; font-size: 31px; line-height: 1; font-weight: 500; }
.ai-chat-close { width: 44px; height: 44px; padding: 0; color: #d7d1c4; background: transparent; border: 1px solid #5e5d54; font-size: 31px; line-height: 1; }
.ai-chat-close:hover, .ai-chat-close:focus-visible { color: var(--white); border-color: #aaa69b; }
.ai-chat-context { display: flex; align-items: flex-start; gap: 11px; padding: 14px 26px; background: #e8dfce; border-bottom: 1px solid var(--line); }
.ai-status-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 8px; background: var(--jade); border-radius: 50%; box-shadow: 0 0 0 4px rgba(63, 103, 85, .13); }
.ai-chat-context p { margin: 0; font-size: 14px; line-height: 1.35; }
.ai-chat-context strong, .ai-chat-context small { display: block; }
.ai-chat-context small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.ai-messages { overflow-y: auto; padding: 24px 24px 8px; scroll-behavior: smooth; }
.ai-message { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.ai-message.user { justify-content: flex-end; }
.ai-avatar { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; color: #df6d5a; background: var(--charcoal); border: 1px solid var(--red); font: 700 16px "Songti SC", "STSong", serif; }
.ai-message > div { max-width: 82%; padding: 12px 14px; background: var(--white); border: 1px solid var(--line); }
.ai-message.user > div { color: var(--white); background: var(--jade); border-color: var(--jade); }
.ai-message p { margin: 0; white-space: pre-wrap; font-size: 16px; line-height: 1.55; }
.ai-message.loading > div { color: var(--muted); font-style: italic; }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 24px 14px; }
.ai-suggestions:empty { display: none; }
.ai-suggestions button { flex: 1 1 45%; min-width: 0; padding: 8px 11px; color: var(--red-dark); background: transparent; border: 1px solid #bfae89; font-size: 12px; line-height: 1.35; text-align: left; }
.ai-suggestions button:hover, .ai-suggestions button:focus-visible { background: var(--white); border-color: var(--red); }
.ai-gate { margin: 8px 18px 14px; padding: 18px; background: #eee5d5; border: 1px solid #bfae89; border-left: 4px solid var(--red); }
.ai-gate[hidden] { display: none; }
.ai-gate .eyebrow { margin: 0 0 5px; color: var(--red-dark); }
.ai-gate h3 { margin: 0; font-size: 24px; line-height: 1.15; }
.ai-gate > p:not(.eyebrow) { margin: 8px 0 14px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.ai-gate a, .ai-gate button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 14px; font: 700 14px/1.2 Georgia, "Times New Roman", serif; }
.ai-gate a { color: var(--white); background: var(--red); border: 1px solid var(--red-dark); text-decoration: none; }
.ai-gate button { margin-left: 7px; color: var(--red-dark); background: transparent; border: 1px solid #bfae89; }
.ai-composer { padding: 14px 18px 18px; background: var(--white); border-top: 1px solid var(--line); }
.ai-composer label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ai-composer textarea { width: 100%; min-height: 70px; max-height: 150px; resize: vertical; padding: 12px 13px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 0; font: 16px/1.45 Georgia, "Times New Roman", serif; }
.ai-composer textarea:focus { outline: 2px solid rgba(166, 60, 47, .2); border-color: var(--red); }
.ai-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 9px; }
.ai-composer-footer > span { color: var(--muted); font-size: 11px; line-height: 1.3; }
.ai-composer-footer button { flex: 0 0 auto; min-width: 92px; min-height: 42px; padding: 8px 13px; color: var(--white); background: var(--red); border: 1px solid var(--red-dark); font-weight: 700; }
.ai-composer-footer button:disabled { opacity: .55; cursor: wait; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art img, .star-tile img { transition: none; }
  .card-loading span { animation: none; }
}

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr .75fr; padding-left: 48px; padding-right: 38px; }
  .hero-art { margin-left: -100px; opacity: .92; }
  .star-rail { grid-template-columns: repeat(4, 1fr); }
  .star-tile { height: 260px; }
  .about { grid-template-columns: 1fr; gap: 42px; }
}

@media (max-width: 960px) {
  .result-layout { max-width: 680px; grid-template-columns: 1fr; gap: 18px; }
  .reading-panel { padding-top: 26px; }
  .reading-panel h3, .reading-intro { max-width: 680px; }
  .chart-details { max-width: 680px; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .site-header { min-height: 68px; padding: 10px 16px; }
  .brand-seal { width: 40px; height: 40px; font-size: 20px; }
  .brand b { font-size: 17px; }
  .site-header nav a:not(.lang-link):not(.account-link) { display: none; }
  .site-header .account-link { font-size: 14px; }
  .site-header .nav-chat { display: none; }
  .site-header .nav-install { font-size: 12px; }
  .hero {
    min-height: auto;
    display: block;
    padding: 0 18px 72px;
  }
  .hero::after { left: 18px; right: 18px; bottom: 52px; }
  .hero-art { min-height: 370px; margin: 0 -18px -56px; opacity: 1; }
  .hero-art::before { top: 6%; right: 4%; font-size: 78px; }
  .hero-art img { inset: 0 0 0 4%; width: 92%; height: 100%; object-position: center top; }
  .orbit-one { width: 340px; height: 340px; top: 10%; }
  .orbit-two { width: 230px; height: 400px; top: 3%; }
  .hero-star-label { right: 12px; bottom: 58px; padding: 8px 12px; }
  .hero-star-label span { font-size: 17px; }
  .hero-copy { position: relative; z-index: 5; }
  .hero h1 { max-width: 520px; font-size: clamp(42px, 13vw, 64px); }
  .lede { margin: 18px 0 24px; font-size: 18px; }
  .source-line { display: block; margin: -8px 0 22px; }
  .source-line strong, .source-line span { display: block; }
  .source-line span { margin-top: 3px; }
  .birth-form { grid-template-columns: 1fr; gap: 12px; }
  .gender-field, .birth-form .primary-action, .relationship-entry, .custom-location, .solar-explainer, .form-note, .form-error { grid-column: 1; }
  .relationship-entry { align-items: flex-start; flex-direction: column; gap: 2px; }
  .custom-location { grid-template-columns: 1fr; gap: 12px; }
  .field input, .field select, .gender-field span { min-height: 50px; font-size: 16px; }
  .next-cue { bottom: 17px; }

  .archetype-strip { padding: 65px 18px 72px; }
  .section-heading h2, .about h2, .result-header h2 { font-size: 38px; }
  .section-heading > p:last-child { font-size: 17px; }
  .star-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 18px 12px; margin: 0 -18px; }
  .star-tile { flex: 0 0 158px; height: 235px; scroll-snap-align: start; }
  .archetype-preview { grid-template-columns: 1fr; gap: 10px; }

  .result { padding: 58px 18px 72px; }
  .result-header { align-items: start; }
  .result-layout { grid-template-columns: 1fr; gap: 16px; }
  .card-preview { min-height: 0; }
  .reading-panel { padding-top: 28px; }
  .reading-panel h3 { font-size: 42px; }
  .reading-intro { font-size: 18px; }
  .reading-columns { grid-template-columns: 1fr; gap: 26px; }
  .blind-spot { padding-left: 16px; }
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .palace { min-height: 138px; padding: 13px; }

  .about { padding: 72px 18px; }
  .steps article { grid-template-columns: 44px 1fr; gap: 12px; }
  .steps article p { grid-column: 2; }
  .trust { display: block; padding: 22px 18px; }
  .trust p + p { margin-top: 8px; }
  footer { grid-template-columns: 1fr; padding: 34px 18px; }

  .ai-chat { width: 100vw; border-left: 0; }
  .ai-chat-header { padding: 18px 16px 16px; }
  .ai-chat-header h2 { font-size: 28px; }
  .ai-chat-context { padding: 12px 16px; }
  .ai-messages { padding: 19px 14px 6px; }
  .ai-message > div { max-width: 86%; }
  .ai-message p { font-size: 17px; }
  .ai-suggestions { padding: 7px 14px 12px; }
  .ai-gate { margin: 6px 12px 12px; padding: 16px; }
  .ai-gate a, .ai-gate button { width: 100%; }
  .ai-gate button { margin: 8px 0 0; }
  .ai-composer { padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 44px; }
  .hero-art { min-height: 335px; }
  .card-actions { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .result-header { display: block; }
  .text-action { margin-top: 18px; }
}
