/* Online page, v2 (15 Nov 2026): clean "fintech" look — white cards with soft deep shadows on a pale ground,
   ink text, one jade accent and a jade-ink-gold angled band: "Jade & Ink", matching the website (Lin's choice, 15 Nov 2026).
   System fonts only: no web fonts are loaded. style.css (copied from TOOL/web) supplies the chart pieces. */
:root {
  --bg: #f5f6f2; --surface: #ffffff; --ink: #17221e; --muted: #4f5d57; --line: #e1e5de;
  --accent: #2f6b57; --accent-ink: #24533f; --accent-soft: #e6f0eb; --on-accent: #ffffff; --now-bg: #e6f0eb;
  --warn-bg: #fff8e6; --warn-ink: #6b4a00; --warn-line: #f5d78e;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 50px 100px -20px rgba(23, 50, 40, 0.22), 0 30px 60px -30px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 2px 5px -1px rgba(23, 50, 40, 0.18), 0 1px 3px -1px rgba(0, 0, 0, 0.2);
  --radius: 12px;
  --band: radial-gradient(at 12% 30%, #3f8a6d 0, transparent 45%), radial-gradient(at 88% 12%, #a8883f 0, transparent 40%),
          radial-gradient(at 70% 85%, #1d4a3c 0, transparent 45%), radial-gradient(at 35% 95%, #0f2a22 0, transparent 50%),
          linear-gradient(120deg, #0d1f1a 0%, #173a2f 35%, #2f6b57 65%, #4f7a5e 85%, #8a7a3e 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1513; --surface: #15211d; --ink: #e6efe9; --muted: #a6b8ae; --line: #26372f;
    --accent: #5fb394; --accent-ink: #8fd0b6; --accent-soft: #16302a; --on-accent: #0b1a14; --now-bg: #16302a;
    --warn-bg: #33290d; --warn-ink: #f6dc8f; --warn-line: #6e5a1d;
    --shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6); --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
}
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); font-size: 16px; position: relative; overflow-x: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shell { max-width: 980px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); position: relative; }
p { max-width: 70ch; }
h2 { font-size: 1.125rem; letter-spacing: -0.01em; color: var(--ink); }

/* gradient band and hero */
.band { position: absolute; top: 0; left: 0; right: 0; height: 560px; background: var(--band); transform: skewY(-6deg); transform-origin: top left; z-index: 0; }
.hero { position: relative; z-index: 1; color: #fff; padding: 20px 0 120px; }
.topbar { margin-bottom: 44px; }
.topbar a { color: rgba(255, 255, 255, 0.9); text-decoration: none; font-weight: 500; font-size: 0.9375rem; }
.topbar a:hover { color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8125rem; font-weight: 600; margin: 0 0 12px; color: rgba(255, 255, 255, 0.85); }
.eyebrow.dark { color: var(--accent); }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; margin: 0 0 16px; max-width: 18ch; text-wrap: balance; }
.hero .lede { font-size: 1.125rem; line-height: 1.6; color: rgba(255, 255, 255, 0.92); max-width: 58ch; margin: 0 0 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 14px; border-radius: 999px; font-size: 0.875rem; font-weight: 500;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; backdrop-filter: blur(6px); }
.embedded .band, .embedded .hero { display: none; }
.embedded main.shell { margin-top: 0; padding-top: 16px; }

main.shell { z-index: 1; display: flex; flex-direction: column; gap: 24px; margin-top: -88px; padding-bottom: 64px; }

/* cards */
.card { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); min-width: 0; }
.card h2 { margin: 0 0 14px; }
.card h3 { font-size: 0.9375rem; margin: 18px 0 8px; color: var(--muted); }
.form-card { box-shadow: var(--shadow); border: 0; padding: 28px; }
#result { display: flex; flex-direction: column; gap: 20px; scroll-margin-top: 16px; }
#result:empty { display: none; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

/* form */
form.birth { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; align-items: end; }
form.birth .span2 { grid-column: 1 / -1; }
form.birth .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; margin: 0; padding: 0; }
form.birth label, form.birth legend { font-size: 0.875rem; font-weight: 500; color: var(--ink); padding: 0; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.8125rem; margin: 0; }
form.birth input[type="date"], form.birth input[type="time"], form.birth input[type="text"], form.birth input[type="number"], form.birth select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; width: 100%; min-width: 0; min-height: 44px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s; }
form.birth input:focus, form.birth select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
form.birth input:disabled, form.birth select:disabled { opacity: 0.45; }

.seg { display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 4px; max-width: 360px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label > span { display: block; text-align: center; padding: 8px 12px; border-radius: 7px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9375rem !important; min-height: 32px; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #c1c9d2; position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

details.options summary, details.more > summary { cursor: pointer; color: var(--accent-ink); font-weight: 500; font-size: 0.9375rem; }
details.options .opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; margin-top: 14px; align-items: end; }

.preview { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 14px 16px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--line); min-height: 54px; }
.preview .label { font-size: 0.75rem; }
.warn-dot { color: var(--warn-ink); background: var(--warn-bg); border-radius: 999px; padding: 1px 8px; font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: 0.9375rem; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--on-accent); border: 0; border-radius: 999px; padding: 11px 20px; min-height: 44px; transition: background .15s, transform .15s; }
.btn:hover { background: var(--accent-ink); }
.btn:hover span[aria-hidden] { transform: translateX(2px); }
.btn span[aria-hidden] { transition: transform .15s; }
.btn.ghost { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--accent-soft); }
.rules { font-size: 0.8125rem; color: var(--muted); margin: 0; }

/* chart */
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 24px; margin-bottom: 18px; }
.chart-head .eyebrow { margin-bottom: 4px; }
.four { font-family: var(--hanzi); font-weight: 700; letter-spacing: 0.08em; font-size: 1.25rem; }
.four.big { font-size: clamp(1.6rem, 6vw, 2.2rem); }
.dm-line { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.firm-line { margin: .35rem 0 0; color: var(--muted); }
.dm-char { font-size: 1.5rem; font-weight: 700; margin: 0 2px; }
.tag { display: inline-block; text-transform: none; letter-spacing: 0; font-size: 0.75rem; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); margin-left: 6px; }
.pillars { border: 0; background: var(--bg); border-radius: 10px; }
.pillar { border-left-color: var(--line); }
.pillar .who b { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.dm { background: var(--accent); }
.warn-card { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.warn-card .checks { padding: 0; border: 0; background: transparent; }
.warn-card p:last-child { margin: 8px 0 0; }
.error { color: var(--fire); font-weight: 500; margin: 0; }

.elements { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.el-row { display: grid; grid-template-columns: 84px 1fr 20px; align-items: center; gap: 12px; }
.el-name { font-weight: 600; font-size: 0.9375rem; }
.bar { height: 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.fill { display: block; height: 100%; border-radius: 999px; }
.bg-e-wood { background: var(--wood); } .bg-e-fire { background: var(--fire); } .bg-e-earth { background: var(--earth); }
.bg-e-metal { background: var(--metal); } .bg-e-water { background: var(--water); }
.el-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

tr.now td { background: var(--now-bg); }
.pill { background: var(--accent); }
details.more[open] > summary { margin-bottom: 4px; }

/* call to action, FAQ, footer */
.cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: center; position: relative; overflow: hidden; border: 0; box-shadow: var(--shadow); }
.cta::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--band); }
.cta h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 8px; }
.cta p { margin-bottom: 0; color: var(--muted); }
.faq h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 16px 0 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.foot p { margin: 0; font-size: 0.8125rem; color: var(--muted); }

.swipe { display: none; font-size: 0.8125rem; color: var(--muted); margin-bottom: 6px; }
@media (max-width: 620px) {
  form.birth { grid-template-columns: minmax(0, 1fr); }
  .form-card, .card { padding: 18px 16px; }
  .hero { padding-bottom: 110px; }
  .topbar { margin-bottom: 28px; }
  .cta { grid-template-columns: minmax(0, 1fr); }
  .pillar { padding: 12px 4px 10px; }
  .pillar .god, .pillar .hidden { font-size: 0.8125rem; }
  #result .scroll > table > tbody > tr:not(.annual-row) > td, table.annual td { white-space: nowrap; }
  #result .scroll > table > tbody > tr.annual-row > td:first-child { display: none; }
  .swipe { display: block; }
  .seg { max-width: none; width: 100%; }
}
/* lunar date entry */
.lunar-row { display: grid; grid-template-columns: minmax(70px, 0.8fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; }
@media (max-width: 620px) { .lunar-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } .lunar-row #l-year { grid-column: 1 / -1; } }
.warn-text { color: var(--warn-ink); }

/* PDF + email card */
.pdf-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px 32px; align-items: start; border: 0; box-shadow: var(--shadow); }
.pdf-card h2 { font-size: 1.375rem; letter-spacing: -0.02em; margin: 0 0 8px; }
.pdf-card p { margin: 0 0 8px; }
#pdf-form { display: flex; flex-direction: column; gap: 12px; }
#pdf-form .field { display: flex; flex-direction: column; gap: 6px; }
#pdf-form label { font-size: 0.875rem; font-weight: 500; }
#pdf-form input[type="email"] { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; min-height: 44px; box-shadow: var(--shadow-sm); }
#pdf-form input[type="email"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; color: var(--ink); line-height: 1.45; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#p-status:empty { display: none; }
.print-head, .print-foot { display: none; }
@media (max-width: 620px) { .pdf-card { grid-template-columns: minmax(0, 1fr); } }

@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .band, .hero, .form-card, .pdf-card, .cta, .faq, .foot, .swipe, details.more, .annual-wrap, tr.annual-row { display: none !important; }
  main.shell { margin-top: 0; padding: 0; gap: 10px; max-width: none; }
  #result { gap: 10px; }
  .card { box-shadow: none; border: 1px solid #ccc; padding: 12px; break-inside: avoid; }
  .print-head { display: block; font-size: 12pt; margin: 0 0 10px; color: #0a2540; }
  .print-foot { display: block; margin-top: 12px; font-size: 9pt; color: #555; }
  .pillar .char { font-size: 30pt; }
  .scroll { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}

/* ---- One visual language with the website (Lin, 16 Nov 2026; relayed by the website chat). The site's
   self-hosted fonts (WEBSITE/assets/fonts/, built by TOOL/fonts/build_fonts.py, SIL OFL): Instrument Serif
   for headings, Noto Serif SC Web for Chinese. Paths are from WEBSITE/chart/; in a local preview of
   online/site/ the files are not there and the fallbacks are used. Paper header instead of the dark band. */
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/instrument-serif-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Noto Serif SC Web"; src: url("../assets/fonts/noto-serif-sc-400.woff2") format("woff2"); font-weight: 300 500; font-display: swap; }
@font-face { font-family: "Noto Serif SC Web"; src: url("../assets/fonts/noto-serif-sc-700.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
:root {
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --hanzi: "Noto Serif SC Web", "Noto Serif SC", "Songti SC", "SimSun", "PMingLiU", serif;
  --paper: #efeee7; --paper-ink: rgba(23, 34, 30, .07);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .09 0 0 0 0 .13 0 0 0 0 .12 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --paper: #111c18; --paper-ink: rgba(230, 239, 233, .05); } }
h1, h2 { font-family: var(--serif); font-weight: 400; font-synthesis: none; letter-spacing: -0.01em; }
.hero h1 { font-weight: 400; letter-spacing: -0.01em; line-height: 1.05; font-size: clamp(2.4rem, 7vw, 4rem); }
.cta h2, .faq h2 { font-size: 1.9rem; letter-spacing: -0.01em; }
.band { background-color: var(--paper);
  background-image: radial-gradient(ellipse at 15% 20%, rgba(47, 107, 87, .10) 0, transparent 45%), radial-gradient(ellipse at 85% 10%, rgba(168, 136, 63, .08) 0, transparent 40%),
    radial-gradient(ellipse at 70% 90%, var(--paper-ink) 0, transparent 50%), var(--grain);
  border-bottom: 1px solid var(--line); }
.hero { color: var(--ink); }
.topbar a { color: var(--accent-ink); }
.topbar a:hover { color: var(--ink); }
.eyebrow { color: var(--accent-ink); }
.hero .lede { color: var(--ink-soft); }
.chip { background: var(--surface); border-color: var(--line); color: var(--ink); backdrop-filter: none; }
.cta::before { background: var(--accent); }
