/* shell, hero, form, shared widgets */
.hdr { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hdr .wrap { display: flex; align-items: center; gap: var(--s3); min-height: 60px; }
.brand { display: flex; align-items: center; gap: var(--s2); color: var(--ink); text-decoration: none; font-weight: 700; font-size: var(--fs-lg); margin-inline-end: auto; }
.brand svg { width: 34px; height: 34px; }
.brand small { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); line-height: 1.2; }
.nav { display: none; gap: var(--s1); }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--on-primary); background: var(--primary); }
.hdr .future { display: none; }
[data-future] { opacity: .65; cursor: not-allowed; }
.theme-ic .sun, .theme-ic .moon { transition: transform .5s var(--ease), opacity .3s; transform-origin: 12px 12px; }
html[data-eff="dark"] .theme-ic .sun { transform: scale(.2) rotate(90deg); opacity: 0; }
html:not([data-eff="dark"]) .theme-ic .moon { transform: scale(.2) rotate(-90deg); opacity: 0; }
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 60; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 20px rgb(0 0 0 / .08); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 0; min-height: 56px; font-size: var(--fs-xs); color: var(--muted); text-decoration: none; font-weight: 600; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--primary); }
html[data-eff="dark"] .tabbar a[aria-current="page"] { color: var(--gold); }
main { padding-bottom: 90px; min-height: 70vh; }
@media (min-width: 900px) { .nav { display: flex; } .tabbar { display: none; } main { padding-bottom: 0; } .hdr .future { display: inline-flex; } }

/* hero */
.hero { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 70% 20%, var(--hero-1), var(--hero-2)); color: var(--hero-ink); isolation: isolate; }
.hero .stars { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero .stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #ffe9ac; opacity: .25; animation: twinkle var(--d, 4s) ease-in-out var(--dl, 0s) infinite; }
@keyframes twinkle { 50% { opacity: 1; transform: scale(1.6); } }
.hero .wrap { display: grid; gap: var(--s5); padding-block: var(--s6) var(--s7); align-items: center; }
.hero h1 { font-size: var(--fs-3xl); margin: 0 0 var(--s3); }
.shimmer { background: linear-gradient(100deg, #f7dc9a 0%, #d9a93f 25%, #fff3cf 50%, #d9a93f 75%, #f7dc9a 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: -250% 0; } }
.hero p.lead { font-size: var(--fs-lg); color: #f1dcc0; max-width: 34ch; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s4); }
.hero .btn.ghost { color: var(--hero-ink); border-color: rgb(247 220 154 / .4); }
.hero .btn.ghost:hover { background: rgb(255 255 255 / .1); }
.trust-line { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s5); font-size: var(--fs-sm); color: #e8cfae; }
.trust-line span { display: inline-flex; gap: 6px; align-items: center; }
.hero-wheel { position: relative; width: min(78vw, 440px); margin-inline: auto; aspect-ratio: 1; will-change: transform; }
.hero-wheel svg { width: 100%; height: 100%; display: block; }
.hero-wheel .spin { transform-origin: 50% 50%; animation: spin 140s linear infinite reverse; } /* ทวนเข็ม = ตามลำดับราศี เมษ→พฤษภ→มิถุน… และทิศที่ดาวเดินในจักร */
.hero-wheel .spin.rev { animation-direction: reverse; animation-duration: 200s; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-wheel .glow { position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(closest-side, rgb(230 188 98 / .28), transparent); animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .7; } }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.1fr .9fr; padding-block: var(--s7); } .hero-wheel { width: 100%; } }

.section { padding-block: var(--s7); }
.section.tight { padding-block: var(--s6); }
.sec-head { max-width: 62ch; margin-bottom: var(--s5); }
.sec-head p { color: var(--ink-2); }
.cards3 { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow-1); position: relative; }
.card.glow-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgb(217 169 63 / .18), transparent 70%); }
.card.glow-card:hover::after { opacity: 1; }
.card h3, .card h4 { margin-bottom: var(--s2); }
.card .ic-wrap { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--gold-soft); color: var(--gold-text); margin-bottom: var(--s3); }
.card .ic-wrap svg { width: 26px; height: 26px; }

/* reveal on scroll */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.rv.in { opacity: 1; transform: none; }
html[data-motion="off"] .rv { opacity: 1; transform: none; }

/* form */
.formcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: clip; }
.steps { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 60px; z-index: 5; }
.ring { width: 44px; height: 44px; flex: none; }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: var(--line); } .ring .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease); transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font: 700 13px var(--font); fill: var(--ink); }
.steps b { display: block; line-height: 1.3; } .steps span { font-size: var(--fs-sm); color: var(--muted); }
.fsec { padding: var(--s5); border-bottom: 1px solid var(--line); }
.fsec:last-of-type { border-bottom: 0; }
.fsec > h3 { display: flex; align-items: center; gap: var(--s3); font-size: var(--fs-lg); margin-bottom: var(--s1); }
.fsec > h3 .n { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: var(--fs-sm); flex: none; }
.fsec > .sub { color: var(--muted); font-size: var(--fs-sm); margin-bottom: var(--s4); }
.grid2 { display: grid; gap: var(--s4); }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .fsec { padding: var(--s6); } }
.field { position: relative; display: grid; gap: 4px; min-width: 0; }
.field > label, .field > .lbl, .grp > legend { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.grp { border: 0; padding: 0; margin: 0; min-width: 0; }
.grp legend { padding: 0; margin-bottom: 4px; }
.ctl { display: flex; gap: var(--s2); }
input[type=text], input[type=number], input[type=search], select, textarea { width: 100%; min-height: 48px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; line-height: 1.4; transition: border-color .2s, box-shadow .2s; min-width: 0; }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgb(217 169 63 / .25); outline: none; }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--red); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.err { color: var(--red); font-size: var(--fs-sm); font-weight: 600; min-height: 0; }
.err:empty { display: none; }
.hint { color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; }
.ctl.date { display: grid; grid-template-columns: 70px 1fr 92px; }
.ctl.time { display: grid; grid-template-columns: repeat(3, 1fr); }
.ctl.time input, .ctl.date input { text-align: center; }
.ctl.time .u { display: none; }
.fl { position: relative; }
.fl input { padding-top: 20px; padding-bottom: 4px; }
.fl > label { position: absolute; left: 15px; top: 13px; font-size: var(--fs-md); color: var(--muted); pointer-events: none; transition: transform .2s var(--ease), color .2s; transform-origin: left top; font-weight: 400; }
.fl input:focus + label, .fl input:not(:placeholder-shown) + label { transform: translateY(-9px) scale(.78); color: var(--gold-text); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { min-height: 44px; padding: 0 var(--s4); border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 var(--fs-sm)/1 var(--font); cursor: pointer; transition: all .2s; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed=true], .chip[aria-checked=true], .chip.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-text); }
.combo { position: relative; }
.combo ul { position: absolute; z-index: 20; inset-inline: 0; top: calc(100% + 4px); max-height: 280px; overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); }
.combo li { padding: 10px 12px; min-height: 44px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.combo li[aria-selected=true], .combo li:hover { background: var(--gold-soft); }
.combo mark { background: transparent; color: var(--gold-text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--gold); }
.combo .tick { color: var(--ok); }
details.disc { border: 1px dashed var(--line); border-radius: 12px; padding: 0 var(--s4); margin-top: var(--s3); }
details.disc > summary { min-height: 48px; display: flex; align-items: center; gap: var(--s2); cursor: pointer; font-weight: 600; color: var(--gold-text); list-style: none; }
details.disc > summary::-webkit-details-marker { display: none; }
details.disc > summary .chev { transition: transform .25s var(--ease); margin-inline-start: auto; }
details.disc[open] > summary .chev { transform: rotate(180deg); }
details.disc > .in { padding-bottom: var(--s4); display: grid; gap: var(--s4); }
.opt { display: grid; gap: var(--s2); padding-block: var(--s3); border-top: 1px solid var(--line); }
.opt:first-child { border-top: 0; }
.opt .t { font-weight: 700; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--bg); position: relative; flex-wrap: wrap; }
.seg button { min-height: 40px; padding: 0 var(--s4); border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: 600 var(--fs-sm) var(--font); cursor: pointer; position: relative; z-index: 1; transition: color .2s; }
.seg button[aria-pressed=true], .seg button[aria-selected=true] { color: var(--on-primary); }
.seg .ind { position: absolute; top: 3px; bottom: 3px; left: 3px; width: 0; border-radius: 999px; background: var(--primary); transition: transform .35s var(--ease), width .35s var(--ease); z-index: 0; }
.submit-bar { position: sticky; bottom: 70px; z-index: 6; padding: var(--s3) var(--s5); background: linear-gradient(transparent, var(--surface) 35%); display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.submit-bar .btn { flex: 1; min-width: 200px; }
@media (min-width: 900px) { .submit-bar { bottom: 0; } }
.form-errors { margin: var(--s4) var(--s5) 0; padding: var(--s3) var(--s4); border-radius: 12px; background: color-mix(in srgb, var(--red) 12%, var(--surface)); border: 1px solid var(--red); color: var(--ink); }
.form-errors ul { margin: 0; padding-inline-start: 20px; }
.check { display: flex; gap: var(--s3); align-items: flex-start; min-height: 44px; padding-block: 6px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 4px; accent-color: var(--primary); flex: none; }
.saved { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.saved .it { display: flex; align-items: center; gap: var(--s2); background: var(--surface-2); border-radius: 12px; padding: 4px 4px 4px 14px; border: 1px solid var(--line); }
.saved .it button.go { flex: 1; text-align: left; background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--ink); font: inherit; cursor: pointer; }
.saved .it b { display: block; } .saved .it span { font-size: var(--fs-xs); color: var(--muted); }

/* misc */
.term { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: help; text-decoration: underline dotted var(--gold); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.pop { position: fixed; z-index: 120; max-width: min(320px, calc(100vw - 24px)); background: var(--ink); color: var(--bg); padding: var(--s3) var(--s4); border-radius: 12px; font-size: var(--fs-sm); line-height: 1.6; box-shadow: var(--shadow-2); animation: popin .18s var(--ease); }
html[data-eff="dark"] .pop { background: var(--surface-2); color: var(--ink); border: 1px solid var(--gold); }
.pop b { display: block; color: var(--gold); }
@keyframes popin { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.toasts { position: fixed; z-index: 150; inset: auto 0 84px 0; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow-2); font-weight: 600; animation: toast .35s var(--ease); }
html[data-eff="dark"] .toast { background: var(--gold); color: #2a0e10; }
.toast svg { width: 22px; height: 22px; } .toast .draw path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .15s forwards; }
@keyframes toast { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.skel { background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 60%, #fff) 50%, var(--surface-2) 70%); background-size: 300% 100%; animation: sk 1.4s linear infinite; border-radius: 10px; min-height: 18px; }
@keyframes sk { to { background-position: -300% 0; } }
.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--ink-2); display: grid; justify-items: center; gap: var(--s3); }
.empty svg { width: 92px; height: 92px; color: var(--gold); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(3deg); } }
.sparkle { position: fixed; z-index: 140; pointer-events: none; width: 6px; height: 6px; border-radius: 50%; background: #f7dc9a; box-shadow: 0 0 6px #d9a93f; }
.foot { background: var(--hero-2); color: #e8cfae; padding: var(--s7) 0 calc(var(--s7) + 56px); font-size: var(--fs-sm); }
.foot a { color: #f7dc9a; } .foot .cols { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.foot h4 { color: #fbefd2; font-size: var(--fs-md); }
@media (min-width: 900px) { .foot { padding-bottom: var(--s7); } }
.vt-fade { animation: vt .35s var(--ease); }
@keyframes vt { from { opacity: 0; transform: translateY(8px); } }
::view-transition-old(root) { animation: .22s ease both vt-out; } ::view-transition-new(root) { animation: .3s ease both vt-in; }
@keyframes vt-out { to { opacity: 0; } } @keyframes vt-in { from { opacity: 0; } }
.gloss dt { font-weight: 700; margin-top: var(--s3); } .gloss dd { margin: 0; color: var(--ink-2); }
.gloss-grid { display: grid; gap: var(--s2) var(--s5); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
details.q { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 var(--s4); }
details.q > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
details.q p { color: var(--ink-2); }

/* ---- audit fixes: tabbar 5 items, legal pages, more sheet, touch targets, focus ---- */
.tabbar { grid-template-columns: repeat(5, 1fr); }
.tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 8px 0; min-height: 56px; font: 600 var(--fs-xs)/1.2 var(--font, inherit); color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; }
.tabbar button svg { width: 24px; height: 24px; }
.linkbtn { background: none; border: 0; padding: 12px 0; min-height: 44px; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; }
.foot a { display: inline-block; padding: 10px 0; min-height: 44px; line-height: 24px; }
.draft-banner { background: var(--gold-soft); color: #3b2a05; border: 1.5px dashed var(--gold-text); border-radius: 12px; padding: var(--s3) var(--s4); margin: var(--s4) 0; }
.legal { max-width: 760px; } .legal h1 { margin-bottom: var(--s3); } .legal-sec { margin-top: var(--s5); } .legal-sec ul { padding-left: 1.2em; } .legal-sec li { margin: .35em 0; line-height: 1.7; }
.moresheet { border: 0; border-radius: 16px 16px 0 0; padding: var(--s4); width: min(100%, 520px); margin: auto 0 0; inset-inline: 0; margin-inline: auto; background: var(--surface); color: var(--ink); }
.moresheet::backdrop { background: rgba(0,0,0,.5); } .moresheet nav { display: grid; } .moresheet nav a { padding: 14px 8px; min-height: 48px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.moresheet .close { float: right; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
html[data-eff="dark"] a:focus-visible, html[data-eff="dark"] button:focus-visible { outline-color: #8fb4ff; }
.chipcheck, .check, .seg button, .term { min-height: 44px; }
@media (max-width: 480px) { .acts .btn.sm { min-width: 44px; } }
/* CLS: reserve the hero height while the page boots */
.boot .skel { min-height: 40vh; }
