/* === style (orig L2) === */
:root{color-scheme:light;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}html{scroll-padding-top:env(safe-area-inset-top,0px)}body{margin:0;padding:0;font:14px -apple-system,BlinkMacSystemFont,sans-serif;background:#fff;color:#000}img{max-width:100%}[hidden]:not([hidden=until-found i]){display:none!important}

/* === money-tab (orig L2) === */
.mny-grp{margin-top:1.75rem}
.mny-gh{display:flex;align-items:center;gap:.6rem;margin:0;font:inherit;font-weight:500;color:var(--ink)}
.mny-gi{margin:.4rem 0 0;color:var(--ink-soft);font-size:var(--fs-dense,.9375rem)}
.mny-card h4{font-family:var(--font-display);font-size:var(--fs-h3);line-height:var(--lh-head);margin:0;font-weight:400;color:var(--ink)}
.mny-card .chips{margin:0 0 .6rem}
.mny-gh .kj{display:grid;place-items:center;width:2.2rem;height:2.2rem;border-radius:9px;border:1px solid color-mix(in srgb,var(--shu) 35%,var(--line));color:var(--shu);font:400 1.25rem/1 var(--font-display)}
#sec-career{scroll-margin-top:5rem}
.mny-go{font:inherit;font-size:var(--fs-label);color:var(--shu);background:none;border:0;padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}

/* === style (orig L18) === */
:root {
  --paper: #F3ECDD; --paper-hi: #FAF6EC; --ink: #2B2522; --ink-soft: #6B6158;
  --line: #D8CCB6; --shu: #C23A2E; --on-shu: #FBF6EA; --shadow: 0 1px 2px rgba(43,37,34,.05), 0 8px 24px -12px rgba(43,37,34,.12);
  --font-display: "Anuphan", "Shippori Mincho", system-ui, sans-serif;
  --font-body: "Anuphan", "Shippori Mincho", system-ui, sans-serif;
  --font-cjk: "Shippori Mincho", "Anuphan", serif;
  /* ── typography tokens (single source of truth) ── fluid values: min @320px → max @1280px */
  --fs-display: min(3.6rem, max(calc(1.85rem + (100vw - 320px) * .0182), 5.6vw));
  --fs-h2-feature: clamp(1.5625rem, calc(1.5625rem + (100vw - 320px) * .0115), 2.25rem);
  --fs-h2: clamp(1.3125rem, calc(1.3125rem + (100vw - 320px) * .0073), 1.75rem);
  --fs-h3: clamp(1.0625rem, calc(1.0625rem + (100vw - 320px) * .0010), 1.125rem);
  --fs-lede: clamp(1rem, calc(1rem + (100vw - 320px) * .0010), 1.0625rem);
  --fs-body: 1rem; --fs-dense: .9375rem; --fs-sub: .875rem; --fs-label: .8125rem; --fs-note: .8125rem; --fs-micro: .75rem;
  --fs-btn: 1rem; --fs-nav: .9375rem; --fs-glyph-2: 1.25rem; --fs-glyph-pillar: clamp(1.75rem, calc(1.25rem + 2.2vw), 2.5rem);
  --lh-display: 1.3; --lh-head: 1.35; --lh-body: 1.8; --lh-dense: 1.65; --lh-ui: 1.45; --lh-glyph: 1.15;
  --fw-body: 400; --fw-ui: 500; --fw-head: 600; --ls-th: 0; --ls-cjk: .08em;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161312; --paper-hi: #211D1B; --ink: #EDE5D6; --ink-soft: #A89E92;
    --line: #36302B; --shu: #E2584B; --on-shu: #1C1917; --shadow: 0 8px 24px -12px rgba(0,0,0,.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161312; --paper-hi: #211D1B; --ink: #EDE5D6; --ink-soft: #A89E92;
  --line: #36302B; --shu: #E2584B; --on-shu: #1C1917; --shadow: 0 8px 24px -12px rgba(0,0,0,.6); color-scheme: dark;
}
* { box-sizing: border-box; }
[lang="zh-Hant"], .kj { font-family: var(--font-cjk); }
h1, h2, h3, h4, p, button, a, small, span, label, input, select { letter-spacing: 0; }
body {
  background: var(--paper); color: var(--ink); transition: background .25s, color .25s;
  font-family: var(--font-body); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-body);
  padding-block: 1.25rem 3rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 880px; margin-inline: auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--fw-head); line-height: var(--lh-head); margin: 0; text-wrap: balance; }
b, strong { font-weight: var(--fw-head); }
p { margin: 0 0 .9rem; max-width: 62ch; }
.soft { color: var(--ink-soft); }
.small { font-size: var(--fs-note); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .08em; }
.seal { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; background: var(--shu); color: var(--on-shu);
  font-family: var(--font-display); font-size: var(--fs-glyph-2); border-radius: 4px; line-height: 1; }
.theme { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--line); background: var(--paper-hi); color: var(--ink);
  cursor: pointer; font-size: 1.05rem; line-height: 1; display: grid; place-items: center; padding: 0; transition: border-color .2s; }
.theme:hover { border-color: var(--ink); }

/* hero */
.hero { display: flex; justify-content: space-between; gap: 1.5rem; padding-block: 2rem 2.25rem; }

.hero-kanji { writing-mode: vertical-rl; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .5em; color: var(--ink-soft);
  border-left: 1px solid var(--line); padding-left: 1rem; align-self: stretch; }

/* form */
.form { background: var(--paper-hi); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 1.75rem; display: grid; gap: 1.5rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1.5rem 2rem; }
.field { display: grid; gap: .3rem; min-width: 0; align-content: start; }
label, .lbl { font-size: var(--fs-sub); letter-spacing: .1em; color: var(--ink-soft); }
input[type="date"], input[type="time"], input[type="number"], select {
  font: inherit; font-size: 1rem; color: var(--ink); background: transparent; width: 100%; min-width: 0;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: .5rem 0; appearance: none; -webkit-appearance: none;
  transition: border-color .2s; cursor: pointer;
}
input:hover, select:hover, input:focus, select:focus { border-bottom-color: var(--ink); outline: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 1.5rem; }
select option { background: var(--paper-hi); color: var(--ink); }
input::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
input:disabled { opacity: .35; }
.dpick { display: grid; grid-template-columns: .7fr 1.3fr 1.4fr; gap: .9rem; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink-soft); letter-spacing: 0; margin-top: .35rem; cursor: pointer; }
.check input { accent-color: var(--shu); width: 1rem; height: 1rem; }
.btn { font: inherit; font-family: var(--font-display); letter-spacing: var(--ls-th); background: var(--shu); color: var(--on-shu); border: 0; border-radius: 4px;
  padding: .8rem 2.5rem; cursor: pointer; justify-self: start; font-size: var(--fs-btn); transition: filter .2s, transform .1s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
:where(input, select, button):focus-visible { outline: 2px solid var(--shu); outline-offset: 3px; }
.btn-line { font: inherit; font-size: var(--fs-sub); background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .9rem; cursor: pointer; transition: border-color .2s; }
.btn-line:hover { border-color: var(--ink); }
.msg { color: var(--shu); font-size: .95rem; margin: 0; }
.sample { display: inline-block; font-size: .8rem; letter-spacing: .08em; border: 1px solid var(--shu); color: var(--shu); padding: .1rem .75rem; margin: 1.5rem 0 0; border-radius: 999px; }

/* sections as cards */
.sec { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1.5rem; background: var(--paper-hi); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); padding: 2rem; margin-top: 1.25rem; }
.sec-label { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.sec-label .kj { writing-mode: vertical-rl; font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .3em; color: var(--shu); }
.sec-label .kj, .sec-label .th { flex: none; }
@media (min-width: 641px) { .sec-label .kj { min-height: 2.7em; } }
.sec-label .th { font-size: var(--fs-sub); letter-spacing: .08em; color: var(--ink-soft); }
.sec h2 { font-size: var(--fs-h2); margin-bottom: .6rem; }
.sub { font-size: var(--fs-label); letter-spacing: .12em; color: var(--ink-soft); margin: 1.5rem 0 .6rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
@media (max-width: 640px) {
  .sec { grid-template-columns: minmax(0, 1fr); gap: .75rem; padding: 1.35rem; }
  .sec-label { flex-direction: row; align-items: baseline; gap: .75rem; }
  .sec-label .kj { writing-mode: horizontal-tb; letter-spacing: .15em; font-size: 1.3rem; }
  .hero-kanji { display: none; }
  .form { padding: 1.25rem; }
}

/* four pillars */
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: 1.25rem 0 1rem; }
.pillar { text-align: center; padding: .9rem .25rem 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.pillar.day { border-color: var(--shu); }
.p-head { display: flex; flex-direction: column; font-size: var(--fs-label); color: var(--ink-soft); letter-spacing: var(--ls-th); line-height: 1.4; }
.p-head b { font-family: var(--font-display); font-weight: 400; font-size: .95rem; color: var(--ink); }
.glyph { font-family: var(--font-display); font-size: var(--fs-glyph-pillar); line-height: 1.15; margin-top: .4rem; }
.pillar.day .glyph.stem { color: var(--shu); }
.p-god { font-size: var(--fs-sub); color: var(--ink-soft); line-height: 1.45; margin-top: .5rem; }
.p-god b { display: block; font-family: var(--font-display); font-weight: 400; font-size: .9rem; color: var(--ink); }
.pillar.empty .glyph { color: var(--line); }
.facts { display: grid; gap: .15rem; font-size: .9rem; color: var(--ink-soft); margin-bottom: .5rem; }
.bars { display: grid; gap: .45rem; max-width: 420px; }
.bar { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 1.5rem; align-items: center; gap: .75rem; font-size: .85rem; }
.bar .track { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--ink-soft); border-radius: 3px; }
.bar.top .fill { background: var(--shu); }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; }
.warn { font-size: .85rem; color: var(--shu); }

/* deities */
.deities { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 1rem; }
.deity { border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem; min-width: 0; background: var(--paper); }
.deity .kind { font-size: var(--fs-sub); letter-spacing: var(--ls-th); color: var(--ink-soft); }
.deity .name { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.4; margin: .2rem 0 .1rem; }
.deity .zh { font-family: var(--font-display); color: var(--ink-soft); font-size: 1rem; margin-bottom: .5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 .75rem; }
.chip { font-size: var(--fs-label); border: 1px solid var(--line); padding: .05rem .75rem; border-radius: 999px; }

/* daily + periods */
.daily-head { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; margin-bottom: 1.25rem; }
.daily-head .field { width: 11rem; }
.nav-btns { display: flex; gap: .5rem; }
.score { display: flex; align-items: center; gap: .4rem; margin-bottom: .4rem; }
.dot { width: .8rem; height: .8rem; border-radius: 50%; border: 1px solid var(--shu); }
.dot.on { background: var(--shu); }
.score-text { font-family: var(--font-display); margin-left: .5rem; font-size: 1.05rem; }
.headline { font-size: var(--fs-h2); margin-bottom: .5rem; }
.lines p { margin-bottom: .6rem; }
.yiji { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1rem 2rem; margin-top: 1.25rem; }
.yiji h3 { font-size: 1rem; display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.yiji ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .9rem; }
.yiji li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dotted var(--line); padding-bottom: .2rem; }
.yiji .zh { font-family: var(--font-display); color: var(--ink-soft); }
.mark { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; font-family: var(--font-display); font-size: .9rem; background: var(--shu); color: var(--on-shu); border-radius: 4px; }
.mark.ji { background: transparent; color: var(--ink); border: 1px solid var(--ink); }

.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 .75rem; }
.tab { font: inherit; font-size: .9rem; background: transparent; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: .3rem 1.1rem; cursor: pointer; transition: all .2s; }
.tab:hover { border-color: var(--ink); color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 1rem; margin-top: 1rem; }
.cat { border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem; background: var(--paper); }
.cat-h { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .5rem; }
.cat-h .kj { font-family: var(--font-display); font-size: var(--fs-glyph-2); color: var(--shu); line-height: 1; }
.cat-h .t { font-family: var(--font-display); font-size: var(--fs-h3); }
.cat .score { margin-bottom: .6rem; }
.cat p { font-size: .9rem; margin: 0 0 .5rem; }

.method ul { margin: 0 0 1rem; padding-left: 1.1rem; max-width: 62ch; font-size: .9rem; color: var(--ink-soft); }
footer { padding: 1.75rem 0 0; font-size: .8rem; color: var(--ink-soft); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* landing + popup */
body.locked { overflow: hidden; }
.theme svg { width: 1.15rem; height: 1.15rem; }
.landing { min-height: calc(100svh - 6rem); display: flex; flex-direction: column; justify-content: center; gap: 1.75rem; padding-block: 1rem 2rem; }
.landing .hero { padding-block: 0; }
.modal { position: fixed; inset: 0; z-index: 50; background: var(--paper); display: flex; justify-content: center; animation: fade .3s both; }
.sheet { width: 100%; max-width: 920px; height: 100%; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border-inline: 1px solid var(--line);
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 3rem max(16px, env(safe-area-inset-left, 0px)); animation: sheetin .45s cubic-bezier(.2,.8,.2,1) both; }
.sheet-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: calc(.9rem + env(safe-area-inset-top, 0px)) 0 .9rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.sheet-bar .ttl { font-family: var(--font-display); letter-spacing: .1em; }
.bar-r { display: flex; align-items: center; gap: .6rem; }
.sheet .sec { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 140ms + 250ms); }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetin { from { opacity: 0; transform: translateY(24px); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) { .modal, .sheet, .sheet .sec { animation: none; } }

/* tiers, places, do/don't, life */
.story { margin-top: 1rem; }
.story p { max-width: 64ch; margin-bottom: 1.15rem; }
.wish { margin-top: 2rem; }
.wish h3 { font-size: 1.125rem; font-weight: 600; display: flex; align-items: center; gap: .65rem; margin-bottom: .85rem; }
.places { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .2rem; font-size: .85rem; }
.places li::before { content: "◦ "; color: var(--shu); }
.dd { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 1rem; margin-top: 1rem; }
.dd .box { border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem; background: var(--paper); }
.dd h3 { font-size: var(--fs-h3); display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.dd ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .45rem; font-size: .9rem; }
.dd li { padding-left: 1rem; position: relative; }
.dd li::before { content: ""; position: absolute; left: 0; top: .85em; width: .45rem; height: 1px; background: var(--ink-soft); }
.life { max-width: 64ch; }
/* back to top */
.totop { position: fixed; z-index: 60; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
  width: 3rem; height: 3rem; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--shu); color: var(--on-shu); box-shadow: 0 6px 18px -6px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .25s, transform .25s, visibility .25s, filter .2s; }
.totop.show { opacity: 1; visibility: visible; transform: none; }
.totop:hover { filter: brightness(1.08); }
.totop svg { width: 1.35rem; height: 1.35rem; }
.sheet .sec { scroll-margin-top: 4.5rem; }

/* ===== design pass: color tokens (indigo ink + five-element colors) ===== */
:root { --paper:#F3ECDD; --paper-hi:#FAF6EC; --ink:#2B2522; --ink-soft:#6B6158; --line:#D8CCB6; --shu:#C23A2E; --on-shu:#FBF6EA; --shadow:none;
  --el0:#4F7A52; --el1:#C4553A; --el2:#A47A2C; --el3:#6F7B88; --el4:#2F5E8C; --good:#4F7A52; --mid:#A47A2C; --low:#BF6A2C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --paper:#1C1917; --paper-hi:#25211E; --ink:#EDE5D6; --ink-soft:#A89E92; --line:#3A332E; --shu:#E2584B; --on-shu:#1C1917;
  --el0:#86BA8B; --el1:#EE8B72; --el2:#DDB567; --el3:#B4BECA; --el4:#78A8DE; --good:#86BA8B; --mid:#DDB567; --low:#EE9A5B; } }
:root[data-theme="dark"] { --paper:#1C1917; --paper-hi:#25211E; --ink:#EDE5D6; --ink-soft:#A89E92; --line:#3A332E; --shu:#E2584B; --on-shu:#1C1917;
  --el0:#86BA8B; --el1:#EE8B72; --el2:#DDB567; --el3:#B4BECA; --el4:#78A8DE; --good:#86BA8B; --mid:#DDB567; --low:#EE9A5B; }

/* type: Thai is never letter-spaced; clear scale; readable weight */
body { font-weight: var(--fw-body); font-size: var(--fs-body); line-height: var(--lh-body); }
.wrap { max-width: 1040px; }
h1, h2, h3 { letter-spacing: 0; line-height: 1.3; }

.sec h2 { font-size: var(--fs-h2); font-weight: 600; margin-bottom: .75rem; }
label, .lbl, .sec-label .th, .kind, .tier-h, .sub, .chip, .btn-line, .sheet-bar .ttl { letter-spacing: 0; }
label, .lbl { font-size: var(--fs-sub); }
.brand { letter-spacing: .04em; }
.small { font-size: var(--fs-note); }
.p-god { font-size: var(--fs-sub); }
.sub { font-size: var(--fs-label); }
.headline { font-size: var(--fs-h2); font-weight: 600; }
.msg, .warn { color: var(--shu); }

/* landing composition: headline left, form right on desktop */
.landing { display: grid; gap: 2.5rem; align-content: center; }
@media (min-width: 900px) { .landing { grid-template-columns: 1.05fr 1fr; align-items: center; gap: 4.5rem; } }
.hero { border: 0; }
.form { border-radius: 14px; padding: 2rem; }
.btn { letter-spacing: var(--ls-th); border-radius: 10px; padding: .95rem 2.5rem; font-weight: 600; font-size: var(--fs-btn); justify-self: stretch; width: 100%; }

/* result composition: one lead card (today), the rest open with hairline dividers */
.sheet { max-width: 960px; border-inline: 0; }
.sheet .sec { animation: none; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; margin-top: 0; padding: 2.75rem 0; grid-template-columns: 7rem minmax(0, 1fr); }
#result > .sec:first-of-type { background: var(--paper-hi); border: 1px solid var(--line); border-radius: 14px; padding: 2.25rem; margin: 1.5rem 0; }
.sec.method { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.sec-label .kj { color: var(--shu); font-size: 1.75rem; }
@media (max-width: 640px) {
  .sheet .sec { grid-template-columns: minmax(0, 1fr); padding: 2rem 0; }
  #result > .sec:first-of-type { padding: 1.35rem; }
}

/* surfaces: containers 14px, inner boxes 10px, one flat style */
.pillar, .deity, .cat, .dd .box { border-radius: 10px; background: var(--paper-hi); }
.pillar.day { border-color: var(--shu); }
.pillar .glyph { font-weight: 600; }

/* color carries meaning: element colors on bars, score colors on dots */
.bar { grid-template-columns: 4.5rem minmax(0, 1fr) 1.5rem; }
.bar .track { height: 8px; border-radius: 4px; }
.bars .bar:nth-child(1) .fill { background: var(--el0); }
.bars .bar:nth-child(2) .fill { background: var(--el1); }
.bars .bar:nth-child(3) .fill { background: var(--el2); }
.bars .bar:nth-child(4) .fill { background: var(--el3); }
.bars .bar:nth-child(5) .fill { background: var(--el4); }
.bar.top > span:first-child { font-weight: 600; }
.score[data-s="1"], .score[data-s="2"] { --sc: var(--low); }
.score[data-s="3"] { --sc: var(--mid); }
.score[data-s="4"], .score[data-s="5"] { --sc: var(--good); }
.dot { width: .75rem; height: .75rem; border: 1.5px solid var(--sc, var(--ink-soft)); }
.dot.on { background: var(--sc, var(--ink)); }
.tab[aria-pressed="true"] { background: var(--shu); color: var(--on-shu); border-color: var(--shu); }

/* balanced inner spacing: content sits centered in every box and pill */
.pillar, .deity, .cat, .dd .box { padding: 1.35rem 1.4rem; }
.pillar { padding: 1.35rem .5rem; }
.pillar .glyph { line-height: 1.25; margin-top: .25rem; }
.deity > :last-child, .cat > :last-child, .dd .box > :last-child { margin-bottom: 0; }
.chips { margin: .5rem 0 .85rem; }
.chip, .tab, .btn-line, .tier-h b { display: inline-flex; align-items: center; justify-content: center; line-height: 1.5; }
.chip { padding: .2rem .85rem; }
.tab { padding: .4rem 1.15rem; }
.btn-line { padding: .4rem 1rem; min-height: 2.25rem; }
.tier-h b { padding: .15rem .75rem; }
.btn { line-height: 1.4; }
.mark { line-height: 1; }

/* Thai glyphs sit high in the line box: shift text down with asymmetric padding */
.tab { padding: .55rem 1.15rem .3rem; }
.btn-line { padding: .55rem 1rem .3rem; }
.chip { padding: .3rem .85rem .12rem; }
.tier-h b { padding: .1rem .8rem .22rem; line-height: 1.4; }
.btn { padding: 1.05rem 2.5rem .85rem; }

/* daily fortune: toolbar | date | summary | labelled blocks */
.daily-head { padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.d-date-main { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.4; }
.d-date-sub { font-size: .9375rem; color: var(--ink-soft); margin-top: .15rem; }
.d-sum { margin-top: 1.5rem; }
.d-sum-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; margin-bottom: .75rem; }
.d-sum .headline, .d-sum .score { margin: 0; }
.d-lead { margin: 0; max-width: 60ch; }
.d-block { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.d-block > p:last-child { margin-bottom: 0; }
.d-label { font-size: var(--fs-dense); color: var(--ink-soft); margin-bottom: .75rem; }
.d-meta { display: grid; gap: .6rem; }
.d-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; font-size: .9375rem; line-height: 1.7; }
.d-row > span:first-child { color: var(--ink-soft); }
@media (max-width: 640px) { .d-row { grid-template-columns: minmax(0, 1fr); gap: .1rem; } }

/* money / work / love / health: four stacked rows, left = title + score, right = text */
.cats { grid-template-columns: minmax(0, 1fr); gap: .85rem; }
.cat { display: grid; grid-template-columns: 12rem minmax(0, 1fr); column-gap: 1.75rem; row-gap: .35rem; align-items: start; }
.cat-h { grid-column: 1; grid-row: 1; margin: 0; }
.cat .score { grid-column: 1; grid-row: 2; margin: 0; }
.cat p { grid-column: 2; margin: 0; }
.cat > p:nth-of-type(1) { grid-row: 1 / span 2; }
.cat p + p { margin-top: .4rem; }
.cat { column-gap: 2rem; }
.cat-l { display: grid; gap: .5rem; }
.cat-r { padding-top: .35rem; }
.cat-r p + p { margin-top: .75rem; }
.tg { display: inline-flex; align-items: center; font-size: .8125rem; line-height: 1.5; padding: .28rem .7rem .1rem; margin-right: .6rem; border: 1px solid; border-radius: 999px; vertical-align: middle; }
.tg.good { color: var(--good); border-color: var(--good); }
.tg.watch { color: var(--low); border-color: var(--low); }
@media (max-width: 640px) { .cat-r { padding-top: 0; } .cat-l { margin-bottom: .6rem; } }
@media (max-width: 640px) {
  .cat { grid-template-columns: minmax(0, 1fr); }
  .cat p, .cat > p:nth-of-type(1) { grid-column: 1; grid-row: auto; }
  .cat p { margin-top: .4rem; }
}

/* ===== background ornament: faint meander lattice, sun glow, seal watermark, fret band ===== */
:root {
  --fret-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M1 19V1h18v18H5V5h10v10H9V9' fill='none' stroke='black' stroke-width='.9'/%3E%3C/svg%3E");
  --fret-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M1 19V1h18v18H5V5h10v10H9V9' fill='none' stroke='black' stroke-width='2.2'/%3E%3C/svg%3E");
}
body::after, .modal::after { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at var(--gx, 90%) var(--gy, 6%), color-mix(in srgb, var(--shu) 8%, transparent) 0, color-mix(in srgb, var(--shu) 3%, transparent) 20%, transparent 36%); }
.modal::after { position: absolute; }
.wrap { position: relative; z-index: 1; }
.sheet { background: transparent; position: relative; z-index: 1; }
.landing { position: relative; isolation: isolate; }
.landing::before { content: "命"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: -1; font-family: var(--font-display);
  font-size: min(52vw, 24rem); line-height: 1; color: var(--shu); opacity: .035; pointer-events: none; white-space: nowrap; }
header.top { position: relative; padding-bottom: 1.5rem; }
header.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: var(--shu); opacity: .28;
  -webkit-mask: var(--fret-band) 0 0 / 10px 10px repeat-x; mask: var(--fret-band) 0 0 / 10px 10px repeat-x; }
/* ===== left sidebar nav: spring pill for the active topic, a hover pill that follows the pointer ===== */
.modal { display: grid; grid-template-columns: minmax(0, 1fr); }
.sheet { justify-self: center; }
.side { position: fixed; z-index: 70; top: 0; bottom: 0; left: 0; width: min(18rem, 86vw); display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); background: var(--paper-hi); border-right: 1px solid var(--line);
  transform: translateX(-102%); visibility: hidden; transition: transform .38s cubic-bezier(.2,.8,.2,1), visibility 0s .38s; }
.modal.side-open .side { transform: none; visibility: visible; transition: transform .38s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.side-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.42); opacity: 0; pointer-events: none; transition: opacity .3s; }
.modal.side-open .side-scrim { opacity: 1; pointer-events: auto; }
body.side-open .totop { opacity: 0; visibility: hidden; }
.side-toggle { display: inline-flex; }
@media (min-width: 960px) {
  .modal { grid-template-columns: 18rem minmax(0, 1fr); }
  .side { position: relative; z-index: 2; width: auto; transform: none; visibility: visible; transition: none; }
  .side-scrim { display: none; }
  .side-toggle { display: none; }
}
.side-brand { display: flex; align-items: center; gap: .7rem; font-family: var(--font-display); font-size: 1.4rem; line-height: 1.3; padding: 0 .6rem 1.1rem; margin-bottom: .85rem; border-bottom: 1px solid var(--line); }
.side-cap { font-size: .8125rem; color: var(--ink-soft); padding: .35rem .9rem .6rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.side-nav { position: relative; isolation: isolate; display: grid; gap: 4px; --press: .95; }
.nav-hover, .nav-active { position: absolute; left: 0; top: 0; width: 100%; height: 0; border-radius: 14px; pointer-events: none; will-change: transform, height; }
.nav-hover { z-index: -2; opacity: 0; transition: opacity .22s;
  background: radial-gradient(9rem circle at var(--mx, 50%) 50%, color-mix(in srgb, var(--hacc, var(--ink)) 16%, transparent), color-mix(in srgb, var(--hacc, var(--ink)) 7%, transparent)); }
.side-nav.hovering .nav-hover { opacity: 1; }
.nav-active { z-index: -1; transform-origin: left center; --acc: var(--a0); background: color-mix(in srgb, var(--acc) 15%, var(--paper-hi)); transition: background .35s; }
.nav-active::before { content: ""; position: absolute; left: 0; top: 24%; bottom: 24%; width: 3px; border-radius: 2px; background: var(--acc); }
.nav-item { display: block; width: 100%; text-align: left; font: inherit; font-size: var(--fs-nav); line-height: 1.4; color: var(--ink-soft); background: transparent; border: 0; border-radius: 14px;
  padding: .72rem .8rem .55rem; cursor: pointer; transition: color .2s; }
.nav-in { display: flex; align-items: center; gap: .85rem; transform: translateX(var(--sx, 0px)); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
.nav-item:active .nav-in { transform: translateX(var(--sx, 0px)) scale(var(--press)); }
.nav-ico { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px; font-family: var(--font-display); font-size: 1rem; line-height: 1;
  color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, transparent); transition: background .3s, color .3s; }
.nav-item:hover { color: var(--ink); }
.nav-item[aria-current="true"] { color: var(--ink); font-weight: 600; }
.nav-item[aria-current="true"] .nav-ico { background: var(--acc); color: var(--on-shu); }
.nav-item:focus-visible { outline-offset: -2px; }
.nav-group { font-size: .8125rem; line-height: 1.4; color: var(--ink-soft); padding: 1.1rem .9rem .35rem; }
.nav-group:first-of-type { padding-top: .25rem; }
.sheet .sec .sec-label .kj { color: var(--acc, var(--shu)); }
@media (prefers-reduced-motion: reduce) { .side, .nav-in, .side-scrim { transition: none; } }

/* element pentagon */
.radar-fig { margin: .5rem 0 0; display: grid; gap: .5rem; max-width: 440px; }
.radar { display: block; width: 100%; height: auto; overflow: visible; }
.radar text { font-family: inherit; }
.rg-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.rg-ring:last-of-type { stroke: color-mix(in srgb, var(--ink-soft) 45%, var(--line)); }
.rg-axis { stroke: var(--line); stroke-width: 1; }
.rg-tick { fill: var(--ink-soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.rg-area { fill: color-mix(in srgb, var(--shu) 16%, transparent); stroke: var(--shu); stroke-width: 2; stroke-linejoin: round; }
.rg-dot { stroke: var(--paper-hi); stroke-width: 2; transition: r .15s; }
.rg-dot-wrap { outline: none; cursor: default; }
.rg-dot-wrap:hover .rg-dot, .rg-dot-wrap:focus-visible .rg-dot { r: 7; }
.rg-lab { fill: var(--ink); font-size: 14px; }
.rg-lab.top { font-weight: 600; }
.rg-lab .kj { fill: var(--ink-soft); font-family: var(--font-display); font-size: 13px; }
.rg-lab .num { font-weight: 600; font-variant-numeric: tabular-nums; }
.radar-fig figcaption { margin: 0; }

/* accent per topic: nine hues tuned to the paper / ink palette */
:root { --a0:#C23A2E; --a1:#A47A2C; --a2:#2F5E8C; --a3:#4F7A52; --a4:#BF6A2C; --a5:#7A5C99; --a6:#2E7F86; --a7:#A8476A; --a8:#6F7B88; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --a0:#E2584B; --a1:#DDB567; --a2:#78A8DE; --a3:#86BA8B; --a4:#EE9A5B; --a5:#B79AD6; --a6:#6CC1C8; --a7:#E08BA9; --a8:#B4BECA; } }
:root[data-theme="dark"] { --a0:#E2584B; --a1:#DDB567; --a2:#78A8DE; --a3:#86BA8B; --a4:#EE9A5B; --a5:#B79AD6; --a6:#6CC1C8; --a7:#E08BA9; --a8:#B4BECA; }


/* ===== v4 look: deep red band, vermilion accent, cream cards ===== */
:root {
  --paper:#F3ECDD; --paper-hi:#FAF6EC; --ink:#2B2522; --ink-soft:#6B6158; --line:#D8CCB6;
  --shu:#C23A2E; --on-shu:#FBF6EA;
  --orange:#C23A2E; --on-orange:#FBF6EA;
  --band:#A92E25; --band-2:#BC4036; --on-band:#FFF8EE; --on-band-soft:#F3CFC8; --gold-on-band:#FFE2B5;
  --shadow: 0 1px 2px rgba(43,37,34,.05), 0 14px 30px -16px rgba(43,37,34,.22);
  --gut-l: max(16px, env(safe-area-inset-left, 0px)); --gut-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper:#161312; --paper-hi:#211D1B; --ink:#EDE5D6; --ink-soft:#A89E92; --line:#36302B;
  --shu:#E2584B; --on-shu:#1C1917; --orange:#E2584B; --on-orange:#1C1917;
  --band:#7A241E; --band-2:#93342C; --on-band:#F6EBDD; --on-band-soft:#E0B9B1; --gold-on-band:#FFD6A0;
  --shadow: 0 14px 30px -16px rgba(0,0,0,.7); color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper:#161312; --paper-hi:#211D1B; --ink:#EDE5D6; --ink-soft:#A89E92; --line:#36302B;
  --shu:#E2584B; --on-shu:#1C1917; --orange:#E2584B; --on-orange:#1C1917;
  --band:#7A241E; --band-2:#93342C; --on-band:#F6EBDD; --on-band-soft:#E0B9B1; --gold-on-band:#FFD6A0;
  --shadow: 0 14px 30px -16px rgba(0,0,0,.7); color-scheme: dark; }

body { padding: 0; font-weight: 400; background: var(--paper); color: var(--ink); }
body.side-open, body.locked { overflow: hidden; }
a { color: inherit; }

/* fills use the vermilion */
.btn, .seal, .mark, .totop, .tab[aria-pressed="true"] { background: var(--orange); color: var(--on-orange); border-color: var(--orange); }
.mark.ji { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn { font-family: var(--font-body); font-weight: 600; letter-spacing: var(--ls-th); }
.pillar.day { border-color: var(--orange); }
:where(input, select, button, a):focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.band :focus-visible, .foot :focus-visible { outline-color: var(--on-band); }
.band .seal, .foot .seal { background: var(--on-band); color: var(--band); }

/* top band */
.band { position: relative; isolation: isolate; overflow: hidden; background: var(--band); color: var(--on-band); padding-left: var(--gut-l); padding-right: var(--gut-r); }
.band::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 220'%3E%3Cg fill='none' stroke='white' stroke-opacity='.09' stroke-width='1.2'%3E%3Cpath d='M-20 170C80 90 170 230 280 150S470 60 640 150'/%3E%3Cpath d='M-20 200C90 130 190 250 300 180S480 100 640 190'/%3E%3Cpath d='M60 10C130 70 220 -20 330 40S520 20 640 70'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat,
    radial-gradient(60rem 26rem at 85% -20%, rgba(255,255,255,.07), transparent 60%); }
.band-in { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding-block: 1.25rem; }
.band .brand { color: var(--on-band); font-size: 1.2rem; letter-spacing: .04em; }
.top-nav { display: flex; gap: 1.6rem; }
.top-nav a { text-decoration: none; font-size: .9375rem; color: var(--on-band); opacity: .92; padding: .3rem 0 .15rem; border-bottom: 2px solid transparent; transition: border-color .2s, opacity .2s; }
.top-nav a:hover { opacity: 1; border-color: var(--on-band); }
.band-r { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; }
.band .theme { background: transparent; border-color: rgba(255,255,255,.3); color: var(--on-band); }
.band .theme:hover { border-color: var(--on-band); }
.cta { display: inline-flex; align-items: center; background: var(--on-band); color: var(--band); font-weight: 600; font-size: var(--fs-sub); text-decoration: none; border-radius: 8px; padding: .6rem 1.15rem .42rem; transition: filter .2s, transform .1s; }
.cta:hover { filter: brightness(1.08); }
.band-hero { position: relative; max-width: 1040px; margin: 0 auto; text-align: center; padding-block: 3.25rem 7rem; }
.band h1 { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: 600; letter-spacing: 0; margin: 0 auto 1.1rem; color: var(--on-band); }
.band-hero p { color: var(--on-band-soft); margin: 0 auto; max-width: 54ch; font-size: 1.0625rem; }
.deco { position: absolute; pointer-events: none; color: var(--on-band-soft); }
.star { width: 1.3rem; height: 1.3rem; fill: currentColor; opacity: .7; }
.star.s1 { left: 9%; top: 3.6rem; } .star.s2 { right: 17%; bottom: 5.4rem; width: 1.1rem; height: 1.1rem; }
.doodle { width: 3.4rem; height: 3.8rem; right: 8%; top: 3rem; color: var(--on-band); opacity: .85; }

/* showcase: form + preview, pulled up over the band */
.showcase { position: relative; z-index: 2; padding-left: var(--gut-l); padding-right: var(--gut-r); margin-top: -4.25rem; }
.showcase-in { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.5rem; align-items: stretch; }
.showcase .form { border: 0; border-radius: 18px; box-shadow: var(--shadow); padding: 2rem; background: var(--paper-hi); align-content: start; }
.form-head { display: grid; gap: .15rem; }
.form-h { font-size: var(--fs-h2); font-weight: 600; }
.form-head p { margin: 0; }
.privacy { margin: 0; text-align: center; }
.vis { position: relative; background: var(--band); color: var(--on-band); border-radius: 18px; box-shadow: var(--shadow); padding: 2rem 2rem 1.75rem; display: grid; gap: 1.25rem; align-content: start; }
.vis-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; line-height: 1.3; }
.vis-label { font-size: var(--fs-sub); color: var(--on-band-soft); }
.vis-head { padding-left: 0; min-height: 0; display: grid; gap: .1rem; align-content: center; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.tile { border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: rgba(255,255,255,.05); text-align: center; padding: .7rem .2rem .85rem; display: grid; }
.tile small { font-size: var(--fs-label); color: var(--on-band-soft); }
.tile .g { font-family: var(--font-display); font-size: clamp(1.7rem, 4.4vw, 2.5rem); line-height: 1.25; font-weight: 600; }
.tile.day .g:first-of-type { color: var(--gold-on-band); }
.count { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; background: rgba(0,0,0,.2); border-radius: 12px; padding: 1rem 1.15rem; }
.count-t { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.cd { display: grid; grid-template-columns: repeat(3, 3.7rem); gap: .5rem; }
.cd b { display: grid; place-items: center; height: 3.1rem; border-radius: 8px; background: var(--on-band); color: var(--band); font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cd span { display: block; margin-top: .25rem; text-align: center; font-size: var(--fs-label); color: var(--on-band-soft); }
.vis-strip { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0; border-top: 1px solid rgba(255,255,255,.2); padding-top: 1rem; }
.vis-strip > div { display: grid; gap: .1rem; padding-right: 1.25rem; }
.vis-strip > div + div { border-left: 1px solid rgba(255,255,255,.2); padding-left: 1.25rem; padding-right: 0; }
.vis-strip small { font-size: .8125rem; color: var(--on-band-soft); }
.vis-strip b { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; line-height: 1.4; }

/* method: numbered cards */
.method2 { padding: 5rem var(--gut-r) 4rem var(--gut-l); }
.method2-in { max-width: 1040px; margin: 0 auto; }
.method2 h2 { text-align: center; font-size: var(--fs-h2-feature); font-weight: 600; }
.lede { text-align: center; color: var(--ink-soft); margin: .6rem auto 0; max-width: 52ch; }
.adv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2.75rem; }
.adv { background: var(--paper-hi); border-radius: 12px; box-shadow: var(--shadow); padding: 2rem 1.75rem 2.25rem; }
.adv .no { font-size: 2.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.adv h3 { font-size: var(--fs-h3); font-weight: 600; margin: 1.1rem 0 .8rem; }
.adv p { margin: 0; font-size: .9375rem; line-height: 1.8; color: var(--ink-soft); }
.adv.first { background: var(--band); color: var(--on-band); }
.adv.first p { color: var(--on-band-soft); }
.notes { margin-top: 1.75rem; background: var(--paper-hi); border-radius: 12px; box-shadow: var(--shadow); padding: 1.75rem 2rem; }
.notes h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: .75rem; }
.notes ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .6rem; color: var(--ink-soft); font-size: .9375rem; max-width: 80ch; }

.foot { background: var(--band); color: var(--on-band-soft); padding: 2rem var(--gut-r) calc(2rem + env(safe-area-inset-bottom, 0px)) var(--gut-l); }
.foot-in { max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.foot .brand { color: var(--on-band); }
.foot p { margin: 0; font-size: .875rem; max-width: none; }

@media (max-width: 860px) {
  .band-in { grid-template-columns: 1fr auto; }
  .top-nav { display: none; }
  .showcase-in { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .adv-grid { grid-template-columns: minmax(0, 1fr); }
  .band-hero { padding-block: 2.5rem 6.5rem; }
  .star.s1 { left: 4%; top: 2.2rem; } .doodle { right: 3%; top: 1.6rem; width: 2.6rem; height: 3rem; }
  .showcase .form { padding: 1.5rem; }
}
@media (max-width: 480px) { .cd { grid-template-columns: repeat(3, 3.2rem); } .vis { padding-inline: 1.25rem; } .vis-strip { grid-template-columns: minmax(0, 1fr); gap: .75rem; } .vis-strip > div + div { border-left: 0; padding-left: 0; } }

/* result page: red lead card (sidebar keeps the light paper style) */
#result > .sec.lead { background: var(--band); color: var(--on-band); border-color: transparent; }
#result > .sec.lead .soft, #result > .sec.lead .sec-label .th { color: var(--on-band-soft); }
#result > .sec.lead .sec-label .kj { color: var(--gold-on-band); }

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .adv.first { background: var(--band-2); } }
:root[data-theme="dark"] .adv.first { background: var(--band-2); }

/* topic rows: left column wide enough for 5 dots + score label on one line */
@media (min-width: 641px) { .cat { grid-template-columns: 10.5rem minmax(0, 1fr); column-gap: 1.25rem; } }
@media (min-width: 641px) and (max-width: 860px) { .cat { grid-template-columns: 9.5rem minmax(0, 1fr); column-gap: 1rem; padding: 1.2rem 1.15rem; } }
@media (min-width: 1200px) { .cat-r p { max-width: none; } }
@media (max-width: 640px) { .cat-l { margin-bottom: .35rem; } .cat-r p + p { margin-top: .5rem; } }
.score { flex-wrap: wrap; row-gap: .15rem; }
.dot { flex: none; }
.score-text { white-space: nowrap; }

/* birth details in the sticky bar */
.ttl-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; min-width: 0; flex: 1; }
.birth { display: flex; flex-wrap: wrap; gap: .35rem .5rem; min-width: 0; }
.bchip { font-size: .8125rem; line-height: 1.5; padding: .28rem .75rem .1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-hi); color: var(--ink-soft); }
.bchip:first-child { color: var(--ink); }
.birth-inline { display: none; padding-top: 1rem; }
@media (max-width: 640px) { .sheet-bar .birth { display: none; } .birth-inline { display: flex; } }
.sheet .sec { scroll-margin-top: 4.5rem; }
@media (min-width: 641px) { .sheet .sec { scroll-margin-top: 4.5rem; } }

/* =====================================================================
   v5 — พรีเมียมแดงไล่เฉด · ลายจีน · เซียมซี
   ===================================================================== */
:root {
  --band-grad: linear-gradient(135deg, #6A1416 0%, #8F241E 34%, #B53A30 68%, #9C2922 100%);
  --band-sheen: radial-gradient(48rem 24rem at 12% 108%, rgba(255,205,130,.20), transparent 62%),
                radial-gradient(40rem 22rem at 92% -10%, rgba(255,235,200,.14), transparent 60%);
  --gold: #FFE2B5; --gold-deep: #E8B866;
  --slip-paper: #FBF3E0; --slip-paper-2: #F3E4C3; --slip-ink: #3A2A22; --slip-red: #B3302A; --slip-gold: #B98A3E;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --band-grad: linear-gradient(135deg, #3A0B0F 0%, #5A1814 38%, #7A2619 72%, #5E1C17 100%);
  --band-sheen: radial-gradient(48rem 24rem at 12% 108%, rgba(255,190,110,.13), transparent 62%), radial-gradient(40rem 22rem at 92% -10%, rgba(255,225,190,.08), transparent 60%); } }
:root[data-theme="dark"] {
  --band-grad: linear-gradient(135deg, #3A0B0F 0%, #5A1814 38%, #7A2619 72%, #5E1C17 100%);
  --band-sheen: radial-gradient(48rem 24rem at 12% 108%, rgba(255,190,110,.13), transparent 62%), radial-gradient(40rem 22rem at 92% -10%, rgba(255,225,190,.08), transparent 60%); }

/* ไล่เฉดแดงทุกพื้นที่สีแดง */
.band, .vis, .foot, .fortune { background: var(--band-grad); }
.adv.first, #result > .sec.lead { background: var(--band-grad) !important; }
.band::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--band-sheen); }
.vis::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: var(--band-sheen); opacity: .7; }
.vis > * { position: relative; }

/* ลายเมฆทองบาง ๆ */
.cl { position: absolute; pointer-events: none; color: var(--gold); overflow: visible; }
.cl.f { --cfill: currentColor; --cspiral: rgba(110,22,22,.75); }
.cl.mir { transform: scaleX(-1); }
.band .cl.a { left: -5rem; bottom: 4.2rem; width: 17rem; opacity: .30; }
.band .cl.b { right: -4rem; top: 1.5rem; width: 15rem; opacity: .10; }
.band .cl.c { left: 13%; top: .5rem; width: 7rem; opacity: .22; }
.band .cl.d { right: 11%; bottom: 5.2rem; width: 9rem; opacity: .22; }
.deco.star { color: var(--gold); opacity: .6; fill: none; }
.band-hero h1, .band-hero p { position: relative; }
@media (max-width: 860px) {
  .band .cl.a { left: -5rem; bottom: 3.5rem; width: 11rem; opacity: .2; }
  .band .cl.b { right: -4rem; width: 9rem; }
  .band .cl.c, .band .cl.d { display: none; }
}

/* เส้นคั่นลายจีนบนพื้นครีม */
.orn-div { display: flex; align-items: center; justify-content: center; gap: .9rem; color: var(--shu); margin: 1rem auto 0; max-width: 18rem; }
.orn-div::before, .orn-div::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, currentColor); opacity: .6; }
.orn-div::after { transform: scaleX(-1); }
.orn-div svg { width: 3rem; height: 1.4rem; --csw: .6; }
.method2 { position: relative; overflow: hidden; }
.method2 .bg-cloud { position: absolute; right: -4rem; top: 2rem; width: 18rem; color: var(--shu); opacity: .08; pointer-events: none; overflow: visible; --cspiral: var(--shu); }
.method2 .bg-cloud.l { left: -5rem; right: auto; top: auto; bottom: 3rem; transform: scaleX(-1); }
.method2-in { position: relative; }

/* ฟุตเตอร์ */
.foot { position: relative; overflow: hidden; }
.foot .foot-in { position: relative; z-index: 1; }
.foot .cl { right: 2rem; bottom: -1.2rem; width: 11rem; opacity: .22; }

/* ============== เซียมซี ============== */
.fortune .cl.l1 { left: -4rem; top: 7rem; width: 17rem; opacity: .22; }
.fortune .cl.r1 { right: -4rem; bottom: 4rem; width: 18rem; opacity: .09; }
.fortune .cl.l2 { left: 8%; bottom: 3rem; width: 8rem; opacity: .18; }
.fortune .cl.r2 { right: 9%; top: 6rem; width: 9rem; opacity: .2; }
@media (max-width: 640px) { .fortune .cl.l2, .fortune .cl.r2 { display: none; } .fortune .cl.l1 { width: 11rem; opacity: .16; } .fortune .cl.r1 { width: 11rem; } }
.fortune { position: relative; isolation: isolate; overflow: hidden; color: var(--on-band); margin-top: 4.5rem;
  padding: 6rem var(--gut-r) 6rem var(--gut-l); text-align: center; }
.fortune::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--band-sheen); }
.fortune-in { position: relative; max-width: 760px; margin: 0 auto; }
.f-eyebrow { display: inline-flex; align-items: center; gap: .7rem; font-size: .9375rem; color: var(--on-band-soft); }
.f-eyebrow .sl { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 4px; background: var(--gold); color: #7A1A18; font-family: var(--font-display); font-size: 1.15rem; line-height: 1; }
.fortune h2 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); font-weight: 600; margin: .9rem 0 .6rem; color: var(--on-band); }
.f-lede { margin: 0 auto; max-width: 48ch; color: var(--on-band-soft); }
.fortune .orn-div { color: var(--gold); margin-block: 1.25rem 0; }

.stage { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 2.25rem; margin: 2.5rem auto 1.5rem; padding: 1rem 0 2.6rem; }
.stage::after { content: ""; position: absolute; left: 50%; bottom: 1.9rem; width: 13rem; height: 1rem; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.28), transparent 70%); z-index: -1; }
.stage::before { content: ""; position: absolute; left: 50%; top: 50%; width: 22rem; height: 22rem; transform: translate(-50%,-50%); border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(255,226,181,.22), rgba(255,226,181,.06) 55%, transparent 70%); }
.cim { position: relative; width: 170px; height: 330px; cursor: pointer; transform-origin: 50% 94%; -webkit-tap-highlight-color: transparent; }
.cim:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; border-radius: 16px; }
/* ก้านเซียมซี: หัวมนมีปุ่มนูนเป็นข้อ ๆ ขอบทอง ลำก้านเรียวตรง สีแดงเข้ม */
.stk { --w: 20px; position: absolute; bottom: 14px; left: 50%; width: var(--w); margin-left: calc(var(--w) / -2); height: 266px;
  transform-origin: 50% 100%; transform: translateX(var(--x,0px)) rotate(var(--r,0deg)); z-index: 1; }
.stk::before { content: ""; position: absolute; z-index: 0; left: calc(var(--w) * .175); right: calc(var(--w) * .175); top: calc(var(--w) * 2.4); bottom: 0;
  background: linear-gradient(90deg, #7A1311, #D8483A 42%, #8E1A16); border-left: 1px solid rgba(255,226,181,.75); border-right: 1px solid rgba(255,226,181,.75); }
.stk::after { content: ""; position: absolute; z-index: 1; left: 0; top: 0; width: 100%; height: calc(var(--w) * 3);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 60'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1' y1='0' y2='0'%3E%3Cstop offset='0' stop-color='%237A1311'/%3E%3Cstop offset='.42' stop-color='%23D8483A'/%3E%3Cstop offset='1' stop-color='%238E1A16'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M3.50 60.00C3.50 58.25 3.62 51.83 3.50 49.50C3.38 47.17 3.15 47.33 2.80 46.00C2.45 44.67 1.57 42.67 1.40 41.50C1.23 40.33 1.53 39.88 1.80 39.00C2.07 38.12 2.75 37.03 3.00 36.20C3.25 35.37 3.40 34.78 3.30 34.00C3.20 33.22 2.77 32.58 2.40 31.50C2.03 30.42 1.23 28.62 1.10 27.50C0.97 26.38 1.28 25.75 1.60 24.80C1.92 23.85 2.73 22.63 3.00 21.80C3.27 20.97 3.40 20.63 3.20 19.80C3.00 18.97 2.17 17.68 1.80 16.80C1.43 15.92 1.07 15.22 1.00 14.50C0.93 13.78 1.17 13.50 1.40 12.50C1.63 11.50 1.97 9.88 2.40 8.50C2.83 7.12 3.23 5.32 4.00 4.20C4.77 3.08 6.00 2.33 7.00 1.80C8.00 1.27 9.00 1.00 10.00 1.00C11.00 1.00 12.00 1.27 13.00 1.80C14.00 2.33 15.23 3.08 16.00 4.20C16.77 5.32 17.17 7.12 17.60 8.50C18.03 9.88 18.37 11.50 18.60 12.50C18.83 13.50 19.07 13.78 19.00 14.50C18.93 15.22 18.57 15.92 18.20 16.80C17.83 17.68 17.00 18.97 16.80 19.80C16.60 20.63 16.73 20.97 17.00 21.80C17.27 22.63 18.08 23.85 18.40 24.80C18.72 25.75 19.03 26.38 18.90 27.50C18.77 28.62 17.97 30.42 17.60 31.50C17.23 32.58 16.80 33.22 16.70 34.00C16.60 34.78 16.75 35.37 17.00 36.20C17.25 37.03 17.93 38.12 18.20 39.00C18.47 39.88 18.77 40.33 18.60 41.50C18.43 42.67 17.55 44.67 17.20 46.00C16.85 47.33 16.62 47.17 16.50 49.50C16.38 51.83 16.50 58.25 16.50 60.00Z' fill='url(%23g)'/%3E%3Cpath d='M3.50 60.00C3.50 58.25 3.62 51.83 3.50 49.50C3.38 47.17 3.15 47.33 2.80 46.00C2.45 44.67 1.57 42.67 1.40 41.50C1.23 40.33 1.53 39.88 1.80 39.00C2.07 38.12 2.75 37.03 3.00 36.20C3.25 35.37 3.40 34.78 3.30 34.00C3.20 33.22 2.77 32.58 2.40 31.50C2.03 30.42 1.23 28.62 1.10 27.50C0.97 26.38 1.28 25.75 1.60 24.80C1.92 23.85 2.73 22.63 3.00 21.80C3.27 20.97 3.40 20.63 3.20 19.80C3.00 18.97 2.17 17.68 1.80 16.80C1.43 15.92 1.07 15.22 1.00 14.50C0.93 13.78 1.17 13.50 1.40 12.50C1.63 11.50 1.97 9.88 2.40 8.50C2.83 7.12 3.23 5.32 4.00 4.20C4.77 3.08 6.00 2.33 7.00 1.80C8.00 1.27 9.00 1.00 10.00 1.00C11.00 1.00 12.00 1.27 13.00 1.80C14.00 2.33 15.23 3.08 16.00 4.20C16.77 5.32 17.17 7.12 17.60 8.50C18.03 9.88 18.37 11.50 18.60 12.50C18.83 13.50 19.07 13.78 19.00 14.50C18.93 15.22 18.57 15.92 18.20 16.80C17.83 17.68 17.00 18.97 16.80 19.80C16.60 20.63 16.73 20.97 17.00 21.80C17.27 22.63 18.08 23.85 18.40 24.80C18.72 25.75 19.03 26.38 18.90 27.50C18.77 28.62 17.97 30.42 17.60 31.50C17.23 32.58 16.80 33.22 16.70 34.00C16.60 34.78 16.75 35.37 17.00 36.20C17.25 37.03 17.93 38.12 18.20 39.00C18.47 39.88 18.77 40.33 18.60 41.50C18.43 42.67 17.55 44.67 17.20 46.00C16.85 47.33 16.62 47.17 16.50 49.50C16.38 51.83 16.50 58.25 16.50 60.00' fill='none' stroke='%23FFE2B5' stroke-opacity='.9' stroke-width='1.1' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.stk { filter: brightness(var(--b,1)); }
.stk:nth-child(1) { --x:-14px; --r:-5deg; --w:20px; --b:0.82; height:248px; z-index:1; }
.stk:nth-child(2) { --x:10px; --r:3.5deg; --w:20px; --b:0.8; height:266px; z-index:1; }
.stk:nth-child(3) { --x:-6px; --r:-2.2deg; --w:21px; --b:0.92; height:284px; z-index:2; }
.stk:nth-child(4) { --x:16px; --r:6deg; --w:20px; --b:0.88; height:254px; z-index:1; }
.stk:nth-child(5) { --x:2px; --r:1deg; --w:22px; --b:1; height:274px; z-index:2; }
.stk:nth-child(6) { --x:-11px; --r:-3.8deg; --w:20px; --b:0.95; height:262px; z-index:2; }
.stk:nth-child(7) { --x:8px; --r:2.5deg; --w:21px; --b:0.9; height:290px; z-index:1; }
.stk:nth-child(8) { --x:-2px; --r:-0.8deg; --w:20px; --b:1.05; height:256px; z-index:2; }
.stk:nth-child(9) { --x:18px; --r:7.5deg; --w:19px; --b:0.78; height:244px; z-index:1; }
.stk.pick { --w: 30px; transform-origin: 50% 50%; bottom: 6px; height: 186px; opacity: 0; z-index: 2; --x: 0px; --r: 0deg; filter: none; }
.stk.pick i { position: absolute; z-index: 2; left: 0; right: 0; top: 30px; display: grid; justify-items: center; gap: .15rem; font-style: normal; color: #FFE9BE; text-shadow: 0 1px 0 rgba(80,10,10,.55); font-family: var(--font-display); font-weight: 600; line-height: 1.1; }
.stk.pick i b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.stk.pick i span { writing-mode: vertical-rl; font-size: .95rem; letter-spacing: .05em; }
/* กระบอกทรงสูง ลายทอง */
.can { position: absolute; left: 50%; bottom: 0; width: 116px; height: 200px; margin-left: -58px; z-index: 3; border-radius: 10px 10px 22px 22px / 8px 8px 20px 20px; overflow: hidden;
  background: linear-gradient(180deg, rgba(0,0,0,.2), transparent 20%, transparent 78%, rgba(0,0,0,.22)), linear-gradient(90deg, #6F1517 0%, #B1352B 26%, #CE5143 44%, #A22C25 72%, #5E1013 100%);
  box-shadow: 0 22px 30px -14px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,226,181,.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; }
.can::before, .can::after { content: ""; position: absolute; left: 0; right: 0; height: 12px; background: linear-gradient(180deg, #F6D698, #C9984F); }
.can::before { top: 0; } .can::after { bottom: 0; }
.can .fret { position: absolute; left: 0; right: 0; height: 10px; background: #F1CF94; opacity: .85; -webkit-mask: var(--fret-band) 0 0 / 10px 10px repeat-x; mask: var(--fret-band) 0 0 / 10px 10px repeat-x; }
.can .fret.t { top: 22px; } .can .fret.b { bottom: 22px; }
.can .cl { width: 48px; opacity: .5; }
.can .cl.k1 { left: -14px; top: 58px; } .can .cl.k2 { right: -14px; bottom: 58px; }
.can .nm { position: relative; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.5; color: var(--gold); padding-top: .15rem; text-shadow: 0 1px 0 rgba(60,8,8,.5); }
.can .nm.sm { font-size: .9rem; font-weight: 400; }
.can .lbl2 { position: relative; display: grid; place-items: center; width: 54px; height: 54px; margin: 6px 0; border-radius: 50%; border: 1.5px solid rgba(255,226,181,.85); color: var(--gold);
  font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1; background: rgba(0,0,0,.12); }
.can .lbl2::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px dashed rgba(255,226,181,.45); }
.cim.shaking { animation: shakeCan .17s ease-in-out infinite; }
.cim.shaking .stk:not(.pick) { animation: jig .2s ease-in-out infinite alternate; animation-delay: calc(var(--n, 0) * -31ms); }
.stk:nth-child(1){--n:1}.stk:nth-child(2){--n:2}.stk:nth-child(3){--n:3}.stk:nth-child(4){--n:4}.stk:nth-child(5){--n:5}.stk:nth-child(6){--n:6}.stk:nth-child(7){--n:7}.stk:nth-child(8){--n:8}.stk:nth-child(9){--n:9}
@keyframes shakeCan { 0% { transform: rotate(-9deg) translateY(0); } 50% { transform: rotate(9deg) translateY(-9px); } 100% { transform: rotate(-9deg) translateY(0); } }
@keyframes jig { from { transform: translateX(var(--x)) translateY(0) rotate(var(--r)); } to { transform: translateX(var(--x)) translateY(-12px) rotate(calc(var(--r) + 3deg)); } }

.plate { position: absolute; left: calc(50% + 92px); bottom: 5.2rem; opacity: 0; transform: scale(0); pointer-events: none; display: grid; place-items: center; align-content: center; width: 6.4rem; height: 6.4rem; border-radius: 50%; border: 1.5px solid rgba(255,226,181,.7);
  background: rgba(0,0,0,.18); box-shadow: inset 0 0 0 5px rgba(0,0,0,.12); transition: background .4s, color .4s; }
.plate small { font-size: var(--fs-label); color: var(--on-band-soft); }
.plate b { font-family: var(--font-display); font-size: 2.7rem; line-height: 1.05; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 2ch; }
.plate.lock b { animation: numPop .75s cubic-bezier(.2,1.4,.4,1) both; }
.plate.lock::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #FFE2B5; animation: ring .9s ease-out forwards; pointer-events: none; }
@keyframes numPop { 0% { transform: scale(0) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.5) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
.plate.lock { opacity: 1; transform: none; animation: platePop .75s cubic-bezier(.2,1.3,.35,1) both; background: linear-gradient(180deg, #FFEBC6, #EFC784); color: #7A1A18; border-color: #FFE2B5; }
.plate.lock small { color: #7A1A18; }
@keyframes platePop { 0% { transform: scale(0) rotate(-25deg); opacity: 0; } 60% { transform: scale(1.18) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }

.f-btn { font: inherit; font-weight: 600; font-size: var(--fs-btn); color: #7A1A18; cursor: pointer; border: 0; border-radius: 999px; padding: 1rem 2.6rem .8rem;
  background: linear-gradient(180deg, #FFF1D6, #F1CB8C); box-shadow: 0 10px 24px -10px rgba(0,0,0,.6); transition: transform .12s, filter .2s; }
.f-btn:hover { filter: brightness(1.05); } .f-btn:active { transform: translateY(1px) scale(.99); }
.f-btn:disabled { opacity: .6; cursor: progress; }
.f-btn:focus-visible { outline: 2px solid var(--on-band); outline-offset: 4px; }
.f-hint.small { margin: .9rem auto 0; color: var(--on-band-soft); opacity: .65; max-width: 44ch; font-size: var(--fs-note); line-height: var(--lh-dense); }

/* ใบคำทำนาย */
.slip { position: relative; max-width: 640px; margin: 3.5rem auto 0; padding: 0 2.25rem 2rem; text-align: left; color: var(--slip-ink);
  background: linear-gradient(180deg, var(--slip-paper), var(--slip-paper-2)); border-radius: 6px; box-shadow: 0 34px 60px -24px rgba(0,0,0,.65);
  animation: unroll 1.25s cubic-bezier(.2,.8,.2,1) both; transform-origin: top center; scroll-margin-top: 2rem; }
.slip::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(185,138,62,.7); border-radius: 3px; pointer-events: none; }
.slip-fret { height: 10px; margin: 0 -2.25rem 1.6rem; background: linear-gradient(90deg, #8F2B22, #B3302A 50%, #8F2B22); border-radius: 6px 6px 0 0; }
.slip-cloud { position: absolute; right: 1.6rem; top: 3.2rem; width: 8rem; color: var(--slip-gold); opacity: .4; pointer-events: none; overflow: visible; }
@media (max-width: 640px) { .slip-cloud { display: none; } }
.slip-rod { position: absolute; left: -10px; right: -10px; height: 14px; border-radius: 7px; background: linear-gradient(180deg, #8F2B22, #6A1416); box-shadow: 0 4px 10px -4px rgba(0,0,0,.5); }
.slip-rod.t { top: -7px; } .slip-rod.b { bottom: -7px; }
.slip-head { display: flex; align-items: center; gap: 1.4rem; padding-inline: .6rem; }
.slip-no { flex: none; width: 6rem; text-align: center; border-right: 1px solid rgba(185,138,62,.7); padding-right: 1.3rem; }
.slip-no small { display: block; font-size: var(--fs-label); color: #7B6755; }
.slip-no b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 3.2rem; line-height: 1.1; color: var(--slip-red); font-variant-numeric: tabular-nums; }
.slip-no .zh { display: block; white-space: nowrap; font-family: var(--font-display); font-size: var(--fs-note); color: #7B6755; }
.grade { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 600; line-height: 1.5; padding: .3rem .85rem .12rem; border-radius: 999px; border: 1px solid; }
.grade.g3 { background: linear-gradient(180deg, #E8B866, #C98F36); color: #4B2A07; border-color: #B98A3E; }
.grade.g2 { background: var(--slip-red); color: #FFF3DF; border-color: var(--slip-red); }
.grade.g1 { color: #6B4B1E; border-color: #B98A3E; background: rgba(185,138,62,.12); }
.grade.g0 { color: #3A2A22; border-color: #3A2A22; background: transparent; }
.slip-zh { font-family: var(--font-display); font-size: clamp(1.9rem, 5vw, 2.5rem); font-weight: 600; line-height: 1.2; margin: .55rem 0 0; letter-spacing: .12em; }
.slip-th { font-size: 1rem; color: #6B5846; margin-top: .15rem; }
.slip-poem { margin: 1.7rem .6rem 1.4rem; padding: 1.15rem 1rem 1rem; text-align: center; font-family: var(--font-display); font-size: 1.2rem; line-height: 1.95; border-block: 1px solid rgba(185,138,62,.7); position: relative; }
.slip-poem::before, .slip-poem::after { content: ""; position: absolute; left: 50%; width: 9px; height: 9px; background: var(--slip-paper-2); border: 1px solid rgba(185,138,62,.9); transform: translateX(-50%) rotate(45deg); }
.slip-poem::before { top: -5px; } .slip-poem::after { bottom: -5px; }
.slip-poem span { display: block; }
.slip-mean { margin: 0 .6rem 1.5rem; max-width: none; font-size: 1rem; color: var(--slip-ink); }
.slip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-inline: .6rem; }
.slip-it { display: grid; grid-template-columns: 2.1rem minmax(0,1fr); gap: .7rem; padding: .85rem .9rem; background: rgba(255,255,255,.5); border: 1px solid rgba(185,138,62,.45); border-radius: 8px; }
.slip-it .k { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 4px; background: var(--slip-red); color: #FFF3DF; font-family: var(--font-display); font-size: 1.05rem; line-height: 1; }
.slip-it h4 { margin: 0 0 .15rem; font-size: .9375rem; font-weight: 600; color: var(--slip-red); }
.slip-it p { margin: 0; font-size: .9rem; line-height: 1.65; max-width: none; color: var(--slip-ink); }
.slip-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin: 1.5rem .6rem 0; padding-top: 1rem; border-top: 1px dashed rgba(185,138,62,.7); }
.slip-foot p { margin: 0; font-size: .8125rem; color: #7B6755; max-width: 34ch; }
.slip-acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.slip-btn { font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; border-radius: 999px; padding: .55rem 1.05rem .32rem; border: 1px solid var(--slip-red); background: transparent; color: var(--slip-red); transition: background .2s, color .2s; }
.slip-btn:hover { background: var(--slip-red); color: #FFF3DF; }
.slip-btn.main { background: var(--slip-red); color: #FFF3DF; }
.slip-btn:focus-visible { outline: 2px solid var(--slip-red); outline-offset: 3px; }
.slip-story { margin: -.4rem .6rem 1.5rem; max-width: none; font-size: .9375rem; color: #5A4636; padding-left: .9rem; border-left: 3px solid rgba(179,48,42,.55); }
.slip-sec { margin: 1.5rem .6rem .7rem; display: flex; align-items: center; gap: .7rem; font-size: .875rem; font-weight: 600; color: var(--slip-red); }
.slip-sec::after { content: ""; flex: 1; height: 1px; background: rgba(185,138,62,.55); }
.slip-lucky { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .6rem; margin-inline: .6rem; text-align: center; }
.slip-lucky > div { padding: .7rem .4rem .55rem; border-radius: 8px; border: 1px dashed rgba(185,138,62,.8); }
.slip-lucky small { display: block; font-size: var(--fs-note); color: #7B6755; }
.slip-lucky b { font-weight: 600; font-size: .95rem; }
.slip > .slip-head, .slip > .slip-poem, .slip > .slip-mean, .slip > .slip-story, .slip > .slip-sec, .slip > .slip-grid, .slip > .slip > .slip-head { animation-delay: .55s; } .slip > .slip-poem { animation-delay: .75s; } .slip > .slip-mean { animation-delay: .9s; }
.slip > .slip-story { animation-delay: 1s; } .slip > .slip-sec { animation-delay: 1.1s; } .slip > .slip-grid { animation-delay: 1.15s; } @keyframes unroll { from { clip-path: inset(0 0 100% 0); opacity: .5; transform: translateY(-10px); } to { clip-path: inset(0 0 0 0); opacity: 1; transform: none; } }
@keyframes slipIn { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 640px) {
  .fortune { padding-block: 5rem 4.5rem; }
    .stage { gap: 1.25rem; }
  .plate { width: 5.2rem; height: 5.2rem; left: calc(50% + 84px); } .plate b { font-size: 2.1rem; }
  .slip { padding-inline: 1.25rem; }   .slip-head { gap: .9rem; padding-inline: .2rem; } .slip-no { width: 4.8rem; padding-right: .8rem; } .slip-no b { font-size: 2.5rem; }
  .slip-grid,   .slip-lucky { margin-inline: .2rem; }
  .slip-poem, .slip-mean, .slip-story, .slip-sec, .slip-foot { margin-inline: .2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cim.shaking, .cim.shaking .stk, .plate.lock, .plate.lock b, .plate.lock::after, .slip, .slip > * { animation: none !important; }
}
/* ตัวเลขใช้ฟอนต์เดียวกับตัวอักษรจีน */
.adv .no, .cd b, .bar .n, .rg-lab .num, .tile .g + .g { font-family: var(--font-display); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.adv .no { font-size: 3rem; line-height: 1; letter-spacing: .02em; }
.cd b { font-size: 1.55rem; }

/* ===== หน้าผลดวง: พื้นหลังสลับแถบสี ให้จังหวะการเลื่อนไม่เป็นแผ่นเดียว ===== */
.sheet { --edge: max(16px, env(safe-area-inset-left, 0px), calc((100% - 928px) / 2)); max-width: none; justify-self: stretch; padding-inline: 0; }
.sheet .sheet-bar { padding-inline: var(--edge); }
.sheet .birth-inline { padding-inline: var(--edge); }
#result > .sample { margin-left: var(--edge); }
#result > .sec { position: relative; border-top: 0; padding-block: clamp(2.25rem, 5vw, 3.5rem); padding-inline: var(--edge); }
#result > .sec.lead { margin-inline: var(--edge); }
#result > .sec:nth-of-type(even) { background: color-mix(in srgb, var(--shu) 6%, transparent); }

/* ===== เลื่อนแล้วค่อย ๆ ทยอยขึ้น ===== */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2,.8,.2,1), transform .6s cubic-bezier(.2,.8,.2,1); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

/* ===== sidebar: แถบเลือกสีแดงทึบมีเงาเรือง ลูกศรขวา หัวข้อกลุ่มจาง ๆ มีเส้นคั่น ===== */
.side { padding-inline: 1.1rem; }
.side-nav { gap: 6px; }
.nav-item { font-size: var(--fs-nav); padding: .8rem .85rem .62rem; border-radius: 16px; }
.nav-in { gap: .9rem; }
.nav-txt { flex: 1; min-width: 0; }
.nav-in::after { content: ""; flex: none; width: .36rem; height: .36rem; margin-right: .5rem; border-top: 1.4px solid currentColor; border-right: 1.4px solid currentColor; transform: rotate(45deg); opacity: .45; transition: opacity .25s; }
.nav-item[aria-current="true"] .nav-in::after { opacity: 1; }
.nav-ico { width: 2.25rem; height: 2.25rem; font-size: .72rem; letter-spacing: 0; white-space: nowrap; color: var(--ink-soft); background: color-mix(in srgb, var(--ink-soft) 16%, transparent); }
.nav-item[aria-current="true"] { color: var(--on-band); font-weight: 500; }
.nav-item[aria-current="true"] .nav-ico { background: rgba(255,255,255,.22); color: var(--on-band); }
/* sidebar icons: inline SVG (วาดเอง สีตาม currentColor) แทนอักษรจีน */
.nav-ico svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }

.nav-active { border-radius: 16px; background: linear-gradient(135deg, var(--shu), var(--band)); box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--shu) 70%, transparent); transition: none; }
.nav-active::before { display: none; }
.nav-hover { border-radius: 16px; background: radial-gradient(9rem circle at var(--mx, 50%) 50%, color-mix(in srgb, var(--shu) 12%, transparent), color-mix(in srgb, var(--shu) 5%, transparent)); }
.nav-group { font-size: .8125rem; color: var(--ink-soft); opacity: .85; padding: 1.2rem .85rem .45rem; }
.nav-group:not(:first-of-type) { margin: .7rem .5rem 0; padding: 1.3rem .35rem .45rem; border-top: 1px solid var(--line); }

/* === style (orig L811) === */
.co{fill:var(--cfill,none);stroke:currentColor;stroke-width:1.3;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}.cs{fill:none;stroke:var(--cspiral,currentColor);stroke-width:var(--csw,1.1);stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}.vis-hint{font-size: var(--fs-sub);color:var(--gold-on-band);text-align:center}

/* === home-features-faq (orig L896) === */
.hf { padding: 4.5rem var(--gut-r) 1rem var(--gut-l); }
.hf-in { max-width: 1040px; margin: 0 auto; }
.hf-eye { text-align: center; font-size: var(--fs-label); color: var(--shu); margin: 0 auto .4rem; max-width: none; }
.hf h2 { text-align: center; font-size: var(--fs-h2-feature); font-weight: 600; }
.hf .lede { margin-top: .6rem; }
.hf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2.25rem; }
.hf-card { background: var(--paper-hi); border: 1.5px solid color-mix(in srgb, var(--shu) 28%, var(--line)); border-radius: 18px; padding: 1.5rem 1.4rem 1.6rem; display: grid; align-content: start; gap: .6rem; }
.hf-card .kj { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 9px; background: var(--shu); color: var(--on-shu); font-family: var(--font-display); font-size: 1.15rem; line-height: 1; }
.hf-card h3 { font-size: var(--fs-h3); font-weight: 600; margin-top: .4rem; }
.hf-card p { margin: 0; font-size: var(--fs-dense); line-height: 1.75; color: var(--ink-soft); }
.hf-cta { display: flex; justify-content: center; margin-top: 2rem; }
.hf-cta a { display: inline-flex; align-items: center; background: var(--shu); color: var(--on-shu); font-weight: 600; text-decoration: none; border-radius: 10px; padding: .95rem 2.5rem .75rem; }
.hf-cta a:hover { filter: brightness(1.08); }
.faq { padding: 3rem var(--gut-r) 5rem var(--gut-l); }
.faq-in { max-width: 760px; margin: 0 auto; }
.faq-list { margin-top: 2rem; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem .25rem 1rem; font-weight: 600; font-size: 1rem; line-height: 1.5; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; flex: none; font-size: 1.4rem; line-height: 1; color: var(--shu); transition: transform .2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list summary:focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; border-radius: 6px; }
.faq-list details p { margin: 0 0 1.2rem; padding: 0 2.25rem 0 .25rem; color: var(--ink-soft); font-size: var(--fs-dense); line-height: 1.8; max-width: none; }
@media (max-width: 860px) { .hf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hf { padding-top: 3.5rem; } }
@media (max-width: 520px) { .hf-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; } .hf-cta a { width: 100%; justify-content: center; } }
/* ===== จังหวะหน้าแรก: สลับแถบพื้น ลดความแน่น ===== */
.fz-strip { padding-bottom: 3.5rem; }
.hf { margin-top: 0; padding: 4rem var(--gut-r) 4.25rem var(--gut-l); background: color-mix(in srgb, var(--shu) 4.5%, transparent); border-block: 1px solid color-mix(in srgb, var(--shu) 12%, var(--line)); }
.hf-grid { gap: 1rem; margin-top: 2rem; }
.hf-card { grid-template-columns: auto minmax(0, 1fr); column-gap: .95rem; row-gap: .2rem; align-content: center; align-items: start; padding: 1.1rem 1.15rem 1.15rem; border: 0; border-radius: 16px; background: var(--paper-hi); box-shadow: 0 1px 2px rgba(43,37,34,.05); }
.hf-card .kj { grid-row: 1 / span 2; width: 2.5rem; height: 2.5rem; font-size: 1.05rem; }
.hf-card h3 { margin: .1rem 0 0; font-size: 1.0625rem; line-height: 1.4; }
.hf-card p { font-size: var(--fs-sub); line-height: 1.65; }
.hf-cta { margin-top: 1.75rem; }
.method2 { padding-top: 4.5rem; }
.faq { padding: 4rem var(--gut-r) 4.5rem var(--gut-l); background: color-mix(in srgb, var(--shu) 4.5%, transparent); border-top: 1px solid color-mix(in srgb, var(--shu) 12%, var(--line)); }
@media (max-width: 860px) { .hf { padding-block: 3rem 3.25rem; } .faq { padding-block: 3rem 3.5rem; } .fz-strip { padding-bottom: 2.5rem; } }
@media (max-width: 520px) {
  .hf-grid { gap: 0; margin-top: 1.5rem; }
  .hf-card { background: none; box-shadow: none; border-radius: 0; padding: 1rem .1rem; border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, var(--line)); }
  .hf-card:last-child { border-bottom: 0; }
  .hf-cta { margin-top: 1.5rem; }
}
/* ===== ที่มาของการคำนวณ: ลดน้ำหนักเป็นรายการกะทัดรัด (ข้อมูลรอง) วางหลัง FAQ ===== */
.faq { background: none; border-top: 0; padding-bottom: 3rem; }
.method2 { padding: 3.25rem var(--gut-r) 3rem var(--gut-l); background: color-mix(in srgb, var(--shu) 4.5%, transparent); border-top: 1px solid color-mix(in srgb, var(--shu) 12%, var(--line)); }
.method2 .orn-div { display: none; }
.method2 h2 { font-size: 1.375rem; }
.method2 .lede { margin-top: .4rem; font-size: var(--fs-sub); }
.method2 .adv-grid { display: block; max-width: 760px; margin: 1.5rem auto 0; border-top: 1px solid var(--line); }
.method2 .adv { display: block; padding: 0; background: none; box-shadow: none; border-radius: 0; }
.method2 .adv-grid .adv-h { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: .85rem; width: 100%; padding: .95rem .25rem .85rem; text-align: left; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; transform: none; }
.method2 .adv-grid .adv-h:hover { transform: none; box-shadow: none; border-color: var(--line); }
.method2 .adv-grid .adv-h .no { flex: none; width: 1.75rem; font-size: 1rem; }
.method2 .adv-grid .adv-h h3 { flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; text-align: left; }
.method2 .adv-grid .adv-h::after, .method2 .adv-grid .adv-h[aria-expanded="true"]::after { content: "+"; position: static; flex: none; width: auto; height: auto; margin: 0; background: none; font-size: 1.4rem; line-height: 1; color: var(--shu); transform: none; transition: transform .2s; }
.method2 .adv-grid .adv-h[aria-expanded="true"] { background: none; color: var(--ink); box-shadow: none; border-color: var(--line); }
.method2 .adv-grid .adv-h[aria-expanded="true"] .no { color: var(--shu); }
.method2 .adv-grid .adv-h[aria-expanded="true"]::after { transform: rotate(45deg); }
.method2 .adv-grid .adv-p { margin: 0; padding: .85rem .25rem 1.1rem 2.6rem; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.method2 .site-note { margin-top: 1.75rem; }

/* === style (orig L1245) === */
#sheet .ov-sum { margin-bottom: 1rem; }
#sheet .ov-eye { font-size: var(--fs-label); letter-spacing: var(--ls-th); color: var(--gold-on-band); margin: 0 0 .4rem; }
#sheet .ov-sum .headline { font-size: var(--fs-h2); line-height: var(--lh-head); }
#sheet .ov-sum .d-lead { max-width: none; font-size: var(--fs-body); line-height: var(--lh-body); margin-top: .5rem; }
#sheet .ov-card { padding: .35rem 1.35rem; border: 1px solid color-mix(in srgb, var(--ink) 9%, var(--line)); border-radius: var(--r-card); background: var(--paper-hi); }
#sheet .ov-sec { padding: 1.05rem 0; }
#sheet .ov-sec + .ov-sec { border-top: 1px dashed var(--line); }
#sheet .ov-sec h4 { margin: 0 0 .4rem; font-size: .9375rem; font-weight: 600; color: var(--shu); }
#sheet .ov-sec p { margin: 0; font-size: var(--fs-dense, .9375rem); line-height: 1.85; }
#sheet .ov-sec p + p { margin-top: .75rem; }
