:root {
  --ink-950: #04110f;
  --ink-900: #061816;
  --ink-850: #09211e;
  --ink-800: #0d2925;
  --jade-500: #6f9d92;
  --jade-300: #a9c3bc;
  --gold-500: #c9a96a;
  --gold-400: #d9bd82;
  --gold-300: #ead3a0;
  --porcelain: #f3eee3;
  --muted: #aab8b3;
  --hairline: rgba(201, 169, 106, .52);
  --hairline-soft: rgba(201, 169, 106, .2);
  --panel: rgba(5, 28, 25, .88);
  --field: rgba(4, 20, 19, .72);
  --shadow-xl: 0 34px 80px rgba(0, 0, 0, .34);
  --display-font: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --ui-font: "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", system-ui, sans-serif;
}

html,
body {
  overflow: hidden;
  color: var(--porcelain);
  background: var(--ink-950);
  font-family: var(--ui-font);
  touch-action: manipulation;
  user-select: none;
}

button,
input {
  font-family: var(--ui-font);
}

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

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 4px;
}

#gameCanvas {
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

html.ziwei-engine-view-active #gameCanvas {
  z-index: 1200;
  opacity: 1;
  pointer-events: auto;
}

html.ziwei-engine-view-active .site-shell {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.site-shell {
  position: fixed;
  z-index: 40;
  inset: 0;
  overflow: hidden;
  color: var(--porcelain);
  background:
    radial-gradient(circle at 78% 24%, rgba(42, 98, 84, .12), transparent 30%),
    linear-gradient(135deg, rgba(4, 17, 15, .08), rgba(4, 18, 16, .7)),
    var(--ink-950);
  pointer-events: auto;
}

.site-shell::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: .28;
  background-image:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 68%);
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 4;
  display: flex;
  height: 76px;
  padding: 0 clamp(24px, 4vw, 64px);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hairline);
  background: rgba(3, 17, 15, .88);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 45px;
  height: 45px;
  overflow: visible;
  color: var(--gold-400);
  filter: drop-shadow(0 4px 12px rgba(201, 169, 106, .14));
  flex: 0 0 auto;
}

.brand-mark circle,
.brand-mark path:not(.brand-star) {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.brand-mark .brand-star {
  fill: var(--gold-400);
  stroke: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--gold-300);
  font-family: var(--display-font);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.15;
}

.brand small {
  margin-top: 4px;
  color: rgba(216, 225, 220, .68);
  font-size: 11px;
  letter-spacing: .16em;
}

.header-history {
  display: inline-flex;
  gap: 8px;
  min-height: 42px;
  padding: 0 8px;
  align-items: center;
  border: 0;
  color: var(--gold-400);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  cursor: pointer;
  text-decoration: none;
}

.header-history svg,
.form-note svg,
.primary-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.app-stage {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(100%, 1500px);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: clamp(18px, 3vh, 34px) clamp(28px, 4vw, 68px);
  grid-template-columns: minmax(0, 1.08fr) minmax(530px, .92fr);
  gap: clamp(30px, 4vw, 72px);
  align-items: center;
}

.intro {
  position: relative;
  min-width: 0;
  min-height: min(76vh, 690px);
  overflow: hidden;
  border-radius: 2px;
}

.intro::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(4, 17, 15, .02) 0%, rgba(4, 17, 15, .05) 62%, rgba(4, 17, 15, .86) 100%),
    linear-gradient(0deg, rgba(4, 17, 15, .7), transparent 48%),
    var(--site-bg-desktop) 34% 50% / cover no-repeat;
  transform: scale(1.015);
  transform-origin: center;
  animation: background-breathe 18s ease-in-out infinite alternate;
}

.intro::after {
  position: absolute;
  inset: 0;
  content: "";
  background: radial-gradient(circle at 30% 22%, transparent 0 40%, rgba(2, 12, 11, .18) 68%, rgba(2, 12, 11, .72) 100%);
  pointer-events: none;
}

.intro-copy {
  position: relative;
  z-index: 2;
  width: min(100%, 660px);
  padding: clamp(54px, 8vh, 90px) 22px 0 clamp(12px, 1.2vw, 22px);
}

.intro-copy h1 {
  max-width: 8em;
  margin: 0;
  color: #f1dbab;
  font-family: var(--display-font);
  font-size: clamp(44px, 5.1vw, 76px);
  font-weight: 700;
  letter-spacing: .035em;
  line-height: 1.14;
  text-wrap: balance;
  text-shadow: 0 8px 36px rgba(0, 0, 0, .48);
}

.intro-copy p {
  margin: 22px 0 0;
  color: rgba(231, 236, 231, .78);
  font-size: clamp(16px, 1.55vw, 22px);
  font-weight: 400;
  letter-spacing: .08em;
  line-height: 1.6;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .66);
}

.celestial-scene {
  position: absolute;
  z-index: 2;
  right: 4%;
  bottom: 8%;
  width: 42%;
  aspect-ratio: 1;
  opacity: .28;
  pointer-events: none;
}

.orbit {
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(218, 189, 129, .35);
  border-radius: 50%;
  animation: orbit-spin 32s linear infinite;
}

.orbit::before,
.orbit::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 18px rgba(217, 189, 130, .8);
  content: "";
}

.orbit::before { transform: translate(-50%, -50%) translateX(50%); }
.orbit::after { transform: translate(-50%, -50%) translateX(-50%); }

.orbit-two {
  inset: 27% 8%;
  transform: rotate(58deg);
  animation-direction: reverse;
  animation-duration: 24s;
}

.chart-form-shell {
  position: relative;
  z-index: 3;
  display: grid;
  padding: clamp(22px, 3vh, 34px) clamp(24px, 2.5vw, 38px);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(12, 48, 42, .7), rgba(3, 21, 19, .94)),
    var(--panel);
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px) saturate(115%);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
}

.chart-form-shell::before,
.chart-form-shell::after {
  position: absolute;
  width: 26px;
  height: 26px;
  content: "";
  opacity: .45;
  pointer-events: none;
}

.chart-form-shell::before {
  top: 9px;
  left: 9px;
  border-top: 1px solid var(--gold-400);
  border-left: 1px solid var(--gold-400);
}

.chart-form-shell::after {
  right: 9px;
  bottom: 9px;
  border-right: 1px solid var(--gold-400);
  border-bottom: 1px solid var(--gold-400);
}

.field-row {
  display: grid;
  min-width: 0;
  margin-bottom: 12px;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.field-row > label,
.field-label {
  color: #e9dfca;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .035em;
  line-height: 1.35;
}

.field-row label small {
  color: rgba(197, 209, 203, .58);
  font-size: 12px;
  font-weight: 500;
}

.native-slot {
  width: 100%;
  height: 48px;
}

.choice-group {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-group button {
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(182, 196, 190, .35);
  border-radius: 10px;
  color: #e8e2d7;
  background: linear-gradient(180deg, rgba(26, 47, 44, .9), rgba(10, 27, 25, .9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease, transform .2s ease;
}

.choice-group button:hover {
  border-color: rgba(217, 189, 130, .7);
  color: var(--gold-300);
}

.choice-group button:active {
  transform: translateY(1px);
}

.choice-group button.is-selected {
  border-color: #e5c98d;
  color: #1b1c16;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), transparent 30%),
    linear-gradient(180deg, #d9ba77, #b98e49);
  box-shadow: inset 0 1px 0 rgba(255, 246, 216, .48), 0 7px 24px rgba(151, 106, 45, .12);
}

.form-note {
  display: flex;
  gap: 9px;
  min-height: 34px;
  margin: 3px 0 14px 146px;
  align-items: flex-start;
  color: rgba(198, 211, 205, .68);
  font-size: 12px;
  line-height: 1.65;
}

.form-note svg {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--jade-300);
  flex: 0 0 auto;
}

.form-actions {
  display: grid;
  gap: 9px;
}

.primary-action,
.secondary-action {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease, border-color .2s ease;
}

.primary-action {
  position: relative;
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid #ead29c;
  color: #1b1a14;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, .14), transparent),
    linear-gradient(180deg, #dfc181 0%, #b88a45 100%);
  box-shadow: inset 0 1px 0 rgba(255, 250, 229, .6), 0 12px 32px rgba(153, 110, 48, .18);
  font-family: var(--display-font);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .18em;
}

.primary-action::before,
.primary-action::after {
  position: absolute;
  top: 7px;
  bottom: 7px;
  width: 8px;
  border-top: 1px solid rgba(76, 52, 22, .4);
  border-bottom: 1px solid rgba(76, 52, 22, .4);
  content: "";
}

.primary-action::before {
  left: 8px;
  border-left: 1px solid rgba(76, 52, 22, .4);
}

.primary-action::after {
  right: 8px;
  border-right: 1px solid rgba(76, 52, 22, .4);
}

.primary-action svg {
  position: absolute;
  right: 22px;
  width: 18px;
  height: 18px;
}

.primary-action:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.secondary-action {
  height: 43px;
  border: 1px solid rgba(201, 169, 106, .62);
  color: var(--gold-400);
  background: rgba(3, 19, 17, .52);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .14em;
}

.secondary-action:hover {
  border-color: var(--gold-300);
  background: rgba(13, 45, 39, .62);
}

/* Native engine inputs are kept intact and aligned to the visible code-native slots. */
#native-ui-layer {
  z-index: 1000;
}

.ziwei-form-control {
  position: fixed !important;
  z-index: 1010;
}

.ziwei-form-name {
  left: var(--native-name-x, -1000px) !important;
  top: var(--native-name-y, -1000px) !important;
  width: var(--native-name-w, 1px) !important;
  height: var(--native-name-h, 1px) !important;
}

.ziwei-form-birthDate {
  left: var(--native-birthDate-x, -1000px) !important;
  top: var(--native-birthDate-y, -1000px) !important;
  width: var(--native-birthDate-w, 1px) !important;
  height: var(--native-birthDate-h, 1px) !important;
}

.ziwei-form-birthPlace {
  left: var(--native-birthPlace-x, -1000px) !important;
  top: var(--native-birthPlace-y, -1000px) !important;
  width: var(--native-birthPlace-w, 1px) !important;
  height: var(--native-birthPlace-h, 1px) !important;
}

.ziwei-form-control input {
  padding: 0 46px 0 16px !important;
  border: 1px solid rgba(201, 169, 106, .58) !important;
  border-radius: 10px !important;
  color: #eee7d8 !important;
  background-color: rgba(3, 21, 19, .84) !important;
  background-repeat: no-repeat !important;
  background-position: right 15px center !important;
  background-size: 20px 20px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 8px 22px rgba(0, 0, 0, .08) !important;
  font: 500 14px/1 var(--ui-font) !important;
  letter-spacing: .01em;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.ziwei-form-name input {
  padding-right: 16px !important;
}

.ziwei-form-birthDate input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9bd82' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5.5' width='17' height='15' rx='2'/%3E%3Cpath d='M7 3.5v4M17 3.5v4M3.5 10h17'/%3E%3C/svg%3E") !important;
}

.ziwei-form-birthPlace input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9bd82' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 5-8 11-8 11S4 15 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='2.4'/%3E%3C/svg%3E") !important;
}

.ziwei-form-control input::placeholder {
  color: rgba(200, 211, 206, .5) !important;
}

.ziwei-form-control input:focus {
  border-color: var(--gold-300) !important;
  background-color: rgba(5, 29, 26, .96) !important;
  box-shadow: 0 0 0 3px rgba(201, 169, 106, .14), 0 14px 32px rgba(0, 0, 0, .2) !important;
}

.ziwei-form-birthDate::after {
  display: none !important;
}

.ziwei-place-results {
  top: calc(100% + 7px) !important;
  border-color: rgba(201, 169, 106, .46) !important;
  border-radius: 10px !important;
  color: #eee8dd !important;
  background: rgba(4, 24, 22, .98) !important;
  box-shadow: 0 20px 42px rgba(0, 0, 0, .42) !important;
}

.ziwei-place-result {
  color: #e8e1d5 !important;
  font-size: 13px !important;
}

.ziwei-place-result:hover,
.ziwei-place-result:active {
  background: rgba(73, 119, 106, .24) !important;
}

.ios-toast {
  border-color: rgba(201, 169, 106, .38) !important;
  color: var(--porcelain) !important;
  background: rgba(4, 26, 23, .96) !important;
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes background-breathe {
  from { transform: scale(1.015) translate3d(0, 0, 0); }
  to { transform: scale(1.045) translate3d(-.6%, -.25%, 0); }
}

@media (max-width: 1040px) {
  .app-stage {
    grid-template-columns: minmax(0, .78fr) minmax(510px, 1fr);
    gap: 26px;
    padding-right: 30px;
    padding-left: 30px;
  }

  .intro-copy h1 { font-size: clamp(40px, 5.7vw, 60px); }
  .field-row { grid-template-columns: 122px minmax(0, 1fr); }
  .form-note { margin-left: 136px; }
}

@media (max-width: 760px) {
  html,
  body {
    overflow: hidden;
    touch-action: pan-y;
  }

  .site-shell {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .site-header {
    position: sticky;
    top: 0;
    height: calc(67px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 20px 0;
  }

  .brand { gap: 9px; }
  .brand-mark { width: 37px; height: 37px; }
  .brand strong { font-size: 17px; letter-spacing: .08em; }
  .brand small { display: none; }

  .header-history {
    gap: 5px;
    min-height: 40px;
    font-size: 12px;
    letter-spacing: .02em;
  }

  .header-history svg { width: 18px; height: 18px; }

  .app-stage {
    display: block;
    min-height: 0;
    padding: 0 0 max(26px, env(safe-area-inset-bottom, 0px));
  }

  .intro {
    min-height: 310px;
    border-bottom: 1px solid var(--hairline);
    border-radius: 0;
  }

  .intro::before {
    background:
      linear-gradient(0deg, rgba(4, 17, 15, .5), transparent 55%),
      linear-gradient(90deg, rgba(4, 17, 15, .08), transparent 72%),
      var(--site-bg-mobile) 26% 52% / auto 108% no-repeat;
  }

  .intro::after {
    background: linear-gradient(180deg, rgba(3, 15, 14, .2), transparent 46%, rgba(3, 15, 14, .52));
  }

  .intro-copy {
    padding: 30px 20px 0;
    text-align: center;
  }

  .intro-copy h1 {
    max-width: none;
    font-size: clamp(32px, 10vw, 44px);
    line-height: 1.22;
  }

  .intro-copy p {
    margin-top: 10px;
    font-size: 14px;
    letter-spacing: .04em;
  }

  .celestial-scene { display: none; }

  .chart-form-shell {
    margin: 0;
    padding: 26px 20px 24px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: linear-gradient(180deg, rgba(6, 31, 28, .98), rgba(3, 19, 17, .98));
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .chart-form-shell::before,
  .chart-form-shell::after {
    display: none;
  }

  .field-row {
    display: block;
    margin-bottom: 20px;
  }

  .field-row > label,
  .field-label {
    display: block;
    margin-bottom: 9px;
    font-size: 15px;
  }

  .native-slot { height: 50px; }
  .choice-group button { height: 48px; font-size: 15px; }

  .form-note {
    margin: -4px 0 18px;
    font-size: 11px;
    line-height: 1.55;
  }

  .primary-action { height: 54px; font-size: 20px; }
  .secondary-action { height: 46px; }

  .ziwei-form-control input {
    font-size: 14px !important;
  }

  .rolldate-container .rolldate-panel,
  .ziwei-lunar-picker-panel {
    border-top-color: rgba(201, 169, 106, .78) !important;
    color: #eee7d9 !important;
    background: linear-gradient(180deg, #10352f 0%, #061a17 100%) !important;
  }

  .rolldate-container header,
  .ziwei-lunar-picker-header {
    border-bottom-color: rgba(201, 169, 106, .28) !important;
    color: var(--gold-300) !important;
    background: rgba(6, 28, 25, .92) !important;
  }
}

@media (max-width: 380px) {
  .site-header { padding-right: 16px; padding-left: 16px; }
  .header-history span { display: none; }
  .intro { min-height: 286px; }
  .intro-copy { padding-right: 16px; padding-left: 16px; }
  .chart-form-shell { padding-right: 16px; padding-left: 16px; }
}

@media (min-height: 900px) and (min-width: 761px) {
  .chart-form-shell { padding-top: 38px; padding-bottom: 38px; }
  .field-row { margin-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro::before,
  .orbit {
    animation: none !important;
  }

  .choice-group button,
  .primary-action,
  .secondary-action {
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   Luminous cloud-palace theme
   Copy, media paths, colors and section visibility are configurable in
   ../site-config.js. These late overrides intentionally keep engine layout
   rules above reusable while replacing the earlier dark visual exploration.
   -------------------------------------------------------------------------- */
:root {
  --theme-ink: #173657;
  --theme-ink-soft: #4c6680;
  --theme-gold: #c99a4c;
  --theme-gold-light: #ead39f;
  --theme-celadon: #8fb2bd;
  --theme-pearl: #fffdf8;
  --theme-panel: rgba(255, 255, 255, .76);
  --site-bg-desktop: url("../assets/images/celestial-palace-clouds-v3.png");
  --site-bg-mobile: url("../assets/images/celestial-palace-clouds-mobile-v3.png");
}

html,
body {
  color: var(--theme-ink);
  background: #edf4f7;
}

.site-shell {
  color: var(--theme-ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .05) 0%, rgba(248, 250, 250, .12) 52%, rgba(235, 243, 247, .44) 100%),
    var(--site-bg-desktop) center center / cover no-repeat;
}

.site-shell::before {
  opacity: .17;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, .72) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 35%, rgba(201, 154, 76, .3) 0 1px, transparent 1.5px);
  background-size: 72px 72px, 104px 104px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

.site-header {
  border-bottom-color: rgba(201, 154, 76, .45);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 10px 36px rgba(72, 102, 126, .08);
  backdrop-filter: blur(22px) saturate(112%);
  -webkit-backdrop-filter: blur(22px) saturate(112%);
}

.brand-mark {
  color: var(--theme-gold);
  filter: drop-shadow(0 4px 12px rgba(201, 154, 76, .18));
}

.brand-mark .brand-star { fill: var(--theme-gold); }

.brand strong {
  color: var(--theme-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}

.brand small { color: rgba(39, 69, 98, .68); }

.header-history { color: #9a6d28; }

.app-stage {
  padding-top: clamp(42px, 6vh, 62px);
  align-items: start;
  background: linear-gradient(90deg, rgba(255, 255, 255, .02), transparent 56%, rgba(236, 243, 246, .12));
}

.intro::before {
  background: none;
  animation: light-breathe 9s ease-in-out infinite alternate;
}

.intro::after {
  background: none;
}

.intro-copy h1 {
  max-width: none;
  color: var(--theme-ink);
  font-size: clamp(44px, 4.2vw, 64px);
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .88), 0 10px 28px rgba(68, 93, 116, .14);
}

.intro-copy { padding-top: 28px; }

.intro-copy p {
  color: rgba(30, 57, 84, .78);
  font-weight: 500;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8), 0 4px 18px rgba(255, 255, 255, .7);
}

.celestial-scene { display: none; }

.chart-form-shell {
  border-color: rgba(201, 154, 76, .58);
  color: var(--theme-ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(245, 249, 250, .68)),
    var(--theme-panel);
  box-shadow: 0 34px 90px rgba(56, 83, 106, .16), inset 0 1px 0 rgba(255, 255, 255, .92);
  backdrop-filter: blur(26px) saturate(108%);
  -webkit-backdrop-filter: blur(26px) saturate(108%);
}

.chart-form-shell::before,
.chart-form-shell::after {
  border-color: var(--theme-gold);
  opacity: .55;
}

.field-row > label,
.field-label {
  color: var(--theme-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .75);
}

.field-row label small { color: rgba(52, 80, 106, .62); }

.choice-group button {
  border-color: rgba(103, 128, 149, .3);
  color: #324d68;
  background: linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(239, 245, 247, .76));
  box-shadow: inset 0 1px 0 #fff, 0 5px 18px rgba(69, 96, 117, .05);
}

.choice-group button:hover {
  border-color: rgba(201, 154, 76, .72);
  color: #8b6226;
}

.choice-group button.is-selected {
  border-color: #d1a251;
  color: #75501f;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .5), transparent 34%),
    linear-gradient(180deg, #fff8e7, #efdbad);
  box-shadow: inset 0 1px 0 #fff, 0 8px 24px rgba(164, 119, 48, .12);
}

.form-note { color: rgba(56, 81, 104, .68); }
.form-note svg { color: #9d762f; }

.primary-action {
  border-color: #e0b664;
  color: #fffdf8;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent),
    linear-gradient(180deg, #dfb55f 0%, #b87b2c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 249, 230, .72), 0 14px 34px rgba(155, 105, 35, .2);
  text-shadow: 0 1px 2px rgba(91, 55, 15, .35);
}

.primary-action::before,
.primary-action::after {
  border-color: rgba(255, 247, 221, .48);
}

.secondary-action {
  border-color: rgba(177, 125, 43, .55);
  color: #936520;
  background: rgba(255, 255, 255, .58);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.secondary-action:hover {
  border-color: #c18c3e;
  color: #71491a;
  background: rgba(255, 255, 255, .82);
}

.ziwei-form-control input {
  border-color: rgba(151, 117, 63, .42) !important;
  color: #203b56 !important;
  background-color: rgba(255, 255, 255, .76) !important;
  background-image: none !important;
  box-shadow: inset 0 1px 0 #fff, 0 8px 22px rgba(74, 101, 123, .06) !important;
}

.ziwei-form-control input::placeholder {
  color: rgba(57, 79, 99, .46) !important;
}

.ziwei-form-control input:focus {
  border-color: #c18c3e !important;
  color: #173657 !important;
  background-color: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 0 0 3px rgba(201, 154, 76, .14), 0 14px 32px rgba(78, 101, 121, .12) !important;
}

.ziwei-form-birthDate input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9893f' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5.5' width='17' height='15' rx='2'/%3E%3Cpath d='M7 3.5v4M17 3.5v4M3.5 10h17'/%3E%3C/svg%3E") !important;
}

.ziwei-form-birthPlace input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9893f' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 5-8 11-8 11S4 15 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='2.4'/%3E%3C/svg%3E") !important;
}

.ziwei-place-results {
  border-color: rgba(181, 132, 54, .48) !important;
  color: #203b56 !important;
  background: rgba(253, 253, 249, .98) !important;
  box-shadow: 0 20px 42px rgba(61, 82, 99, .18) !important;
}

.ziwei-place-result { color: #28445f !important; }

.ziwei-place-result:hover,
.ziwei-place-result:active {
  background: rgba(213, 228, 232, .56) !important;
}

.ios-toast {
  border-color: rgba(201, 154, 76, .42) !important;
  color: #fffdf8 !important;
  background: rgba(24, 52, 73, .94) !important;
}

@keyframes light-breathe {
  from { opacity: .78; transform: scale(1.01); }
  to { opacity: 1; transform: scale(1.025); }
}

@media (max-width: 760px) {
  .site-shell {
    background: #f8fafb;
  }

  .site-shell::before { display: none; }

  .app-stage {
    padding-top: 0;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }

  .site-header {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: calc(64px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 22px 0;
    border-bottom: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .brand-mark {
    width: 35px;
    height: 35px;
    filter: drop-shadow(0 2px 6px rgba(255, 255, 255, .72));
  }

  .brand strong {
    color: #173d61;
    font-size: 17px;
    letter-spacing: .09em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
  }

  .header-history {
    min-height: 38px;
    padding: 0;
    color: #a27127;
    font-size: 12px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
  }

  .intro {
    min-height: clamp(328px, 43.5vh, 360px);
    border-bottom: 0;
  }

  .intro::before {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .28) 0%, transparent 26%, transparent 72%, rgba(247, 250, 251, .42) 100%),
      var(--site-bg-mobile) 35% 38% / 135% auto no-repeat;
    animation: light-breathe-mobile 10s ease-in-out infinite alternate;
  }

  .intro::after {
    background:
      radial-gradient(circle at 54% 19%, rgba(255, 255, 255, .26), transparent 35%),
      linear-gradient(180deg, rgba(255, 255, 255, .12), transparent 42%, rgba(247, 250, 251, .28));
  }

  .intro-copy {
    padding: calc(76px + env(safe-area-inset-top, 0px)) 18px 0;
    text-align: center;
  }

  .intro-copy h1 {
    max-width: none;
    font-size: clamp(27px, 7.2vw, 30px);
    line-height: 1.2;
    letter-spacing: .045em;
    white-space: normal;
    text-shadow: 0 1px 0 #fff, 0 5px 18px rgba(255, 255, 255, .78);
  }

  .intro-copy p {
    margin-top: 7px;
    font-size: 13px;
    letter-spacing: .035em;
    color: rgba(31, 63, 91, .72);
    text-shadow: 0 1px 0 #fff, 0 3px 14px #fff;
  }

  .chart-form-shell {
    z-index: 8;
    width: 100%;
    margin: -18px 0 0;
    padding: 50px 20px 26px;
    border: 0;
    border-radius: 0;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .99), rgba(248, 250, 251, .99));
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
  }

  .chart-form-shell::before {
    display: block;
    top: -33px;
    left: 0;
    width: 100%;
    height: 70px;
    border: 0;
    opacity: 1;
    background: url("../assets/images/mobile-jade-gate-divider-v1.png") center top / 100% 70px no-repeat;
  }

  .chart-form-shell::after {
    display: none;
  }

  .field-row {
    display: grid;
    min-height: 54px;
    margin-bottom: 12px;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
  }

  .field-row > label,
  .field-label {
    margin: 0;
    padding-left: 16px;
    color: #173c60;
    font-family: var(--display-font);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .035em;
    line-height: 1.42;
    text-shadow: none;
  }

  .field-row label small {
    display: block;
    margin-top: 2px;
    color: rgba(67, 91, 112, .62);
    font-family: var(--ui-font);
    font-size: 10px;
    font-weight: 500;
  }

  .native-slot {
    height: 46px;
  }

  .choice-group { gap: 0; }

  .choice-group button {
    height: 46px;
    border-color: rgba(174, 151, 110, .34);
    border-radius: 2px;
    color: #294964;
    background: rgba(255, 255, 255, .76);
    box-shadow: none;
    font-size: 14px;
  }

  .choice-group button + button { border-left-width: 0; }

  .choice-group button:hover {
    border-color: rgba(183, 135, 58, .55);
    color: #7b541d;
  }

  .choice-group button.is-selected {
    border-color: #c08d3c;
    color: #80551c;
    background: #f5e8ca;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .88);
  }

  .form-note {
    display: none;
  }

  .form-actions {
    gap: 0;
    margin: 10px 60px 0;
  }

  .primary-action {
    height: 58px;
    border: 0;
    border-radius: 0;
    color: #fffdf6;
    background: url("../assets/images/mobile-primary-frame-v1.png") center / 100% 100% no-repeat;
    box-shadow: none;
    font-size: 19px;
    letter-spacing: .2em;
    text-shadow: 0 1px 2px rgba(17, 44, 67, .35);
  }

  .primary-action::before,
  .primary-action::after,
  .primary-action svg {
    display: none;
  }

  .secondary-action {
    display: none;
  }

  .ziwei-form-control input {
    border-color: rgba(174, 151, 110, .38) !important;
    border-radius: 2px !important;
    color: #244560 !important;
    background-color: rgba(255, 255, 255, .86) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .96) !important;
    font-size: 13px !important;
  }

  .ziwei-form-control input:focus {
    border-color: #bc8938 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 2px rgba(188, 137, 56, .12) !important;
  }

  .rolldate-container .rolldate-panel,
  .ziwei-lunar-picker-panel {
    border-top-color: rgba(201, 154, 76, .7) !important;
    color: #29445f !important;
    background: rgba(247, 244, 236, .84) !important;
    box-shadow: 0 -18px 48px rgba(25, 45, 61, .22) !important;
    backdrop-filter: blur(20px) saturate(1.12) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.12) !important;
  }

  .rolldate-container header,
  .ziwei-lunar-picker-header {
    border-bottom-color: rgba(201, 154, 76, .28) !important;
    color: #8e6122 !important;
    background: rgba(255, 253, 247, .68) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
  }

  .rolldate-container .rolldate-btn {
    color: #6d5d76 !important;
  }

  .rolldate-container .rolldate-confirm {
    color: #a66e16 !important;
  }

  .rolldate-container .rolldate-wrapper > div,
  .rolldate-container .rolldate-wrapper li {
    color: #244560 !important;
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .78);
  }

  .rolldate-container .rolldate-dim {
    background: transparent !important;
  }

  .rolldate-container .mask-top {
    border-bottom-color: rgba(190, 139, 56, .48) !important;
    background: linear-gradient(180deg, rgba(250, 248, 242, .94) 0%, rgba(250, 248, 242, .28) 100%) !important;
  }

  .rolldate-container .mask-bottom {
    border-top-color: rgba(190, 139, 56, .48) !important;
    background: linear-gradient(0deg, rgba(241, 244, 241, .94) 0%, rgba(241, 244, 241, .28) 100%) !important;
  }
}

@media (max-width: 380px) {
  .chart-form-shell {
    width: 100%;
    margin: -16px 0 0;
    padding-right: 16px;
    padding-left: 16px;
  }

  .field-row {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px;
  }

  .form-actions {
    margin-right: 50px;
    margin-left: 50px;
  }
}

@keyframes light-breathe-mobile {
  from { transform: scale(1.005) translate3d(0, 0, 0); }
  to { transform: scale(1.025) translate3d(0, -.4%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .intro::before { animation: none !important; }
}
