/* มูเตลู — ระบบดีไซน์: พื้นครามเข้ม ตัวอักษรงาช้าง ทองใช้เฉพาะจุดสำคัญ */
:root {
  --bg: #0d0a16;
  --surface: #161224;
  --surface-2: #1e1830;
  --surface-3: #282040;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3eee5;
  --text-2: #c9c1d6;
  --muted: #8f87a3;
  --gold: #d6b26a;
  --gold-2: #ecd39b;
  --gold-soft: rgba(214, 178, 106, 0.12);
  --violet: #8b6fd6;
  --good: #66c79a;
  --warn: #e3a764;
  --bad: #e4707d;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --nav-h: 68px;
  --serif: 'Noto Serif Thai', 'Trirong', serif;
  --sans: 'IBM Plex Sans Thai', 'Sarabun', 'Leelawadee UI', sans-serif;
  font-size: 18px;
}
:root[data-size="l"] { font-size: 20px; }
:root[data-size="xl"] { font-size: 23px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(120% 60% at 50% -10%, rgba(139, 111, 214, 0.18), transparent 60%);
  background-repeat: no-repeat;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.35; }
h1 { font-family: var(--serif); font-size: 1.55rem; letter-spacing: -0.01em; }
h2 { font-family: var(--serif); font-size: 1.18rem; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .6rem; color: var(--text-2); }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.22em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.overline { font-size: .78rem; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.gold { color: var(--gold-2); }

.app { max-width: 540px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 32px); }

/* ส่วนหัว */
.hdr { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 6px 2px 18px; }
.hdr h1 { margin-top: 2px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 2px 0 16px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn .ic { width: 22px; height: 22px; }
.icon-btn.disabled { opacity: .3; pointer-events: none; }
.topbar .title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 1.3rem; }
.topbar .sub { color: var(--muted); font-size: .84rem; }

/* ป้ายฟรี / พรีเมียม */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 600; letter-spacing: .03em; white-space: nowrap; line-height: 1.6; flex: none; }
.tag .ic { width: 12px; height: 12px; vertical-align: 0; }
.tag.free { color: #9fe0c0; background: rgba(102, 199, 154, 0.12); border: 1px solid rgba(102, 199, 154, 0.3); }
.tag.pro { color: #2a1d05; background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.tag.part { color: var(--gold-2); background: var(--gold-soft); border: 1px solid rgba(214, 178, 106, 0.35); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .8rem; color: var(--muted); margin: 0 2px 22px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* พื้นผิว */
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; }
.surface.flush { padding: 0; overflow: hidden; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 2px 12px; }
.section-title h2 { font-size: 1.05rem; }

/* ฮีโร่ดวงวันนี้ */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 22px 20px 6px; margin-bottom: 12px;
  background: linear-gradient(160deg, #241a3d 0%, #171126 60%);
  border: 1px solid rgba(214, 178, 106, 0.22);
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 178, 106, 0.16), transparent 70%); pointer-events: none;
}
.hero-top { display: flex; gap: 18px; align-items: center; }
.hero-top .txt { flex: 1; min-width: 0; }
.hero-top h2 { font-size: 1.12rem; margin: 6px 0 4px; }
.hero .tag { position: relative; z-index: 1; }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, 0.08); }
.ring .val { stroke: url(#ringGrad); transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }
.ring .lbl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .lbl b { font-family: var(--serif); font-size: 1.45rem; color: var(--gold-2); line-height: 1.1; }
.ring .lbl span { font-size: .72rem; color: var(--muted); }

/* แถวคะแนน 4 ด้าน */
.aspects { margin-top: 18px; border-top: 1px solid var(--line); }
.aspect-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.aspect-row:last-child { border-bottom: none; }
.aspect-row .ic { color: var(--gold); }
.aspect-row .name { flex: 1; font-size: .95rem; }
.aspect-row .lv { font-size: .78rem; color: var(--muted); width: 4.2em; text-align: right; }
.meter { display: flex; gap: 3px; }
.meter i { width: 16px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); }
.meter i.on { background: var(--gold); }
.meter.l1 i.on, .meter.l2 i.on { background: var(--warn); }
.link-row { display: flex; align-items: center; gap: 10px; padding: 14px 0; color: var(--gold-2); font-weight: 500; font-size: .92rem; }
.link-row .grow { flex: 1; }
.hero .link-row { border-top: 1px solid var(--line); margin-top: 4px; }

/* ไทล์ศาสตร์รายวัน */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px 14px 14px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); transition: transform .15s, border-color .15s;
}
.tile:active { transform: scale(.985); border-color: var(--line-strong); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tile-top .ic { width: 22px; height: 22px; color: var(--gold); }
.tile-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.tile-value { font-family: var(--serif); font-size: 1.12rem; line-height: 1.35; color: var(--text); }
.tile-value.big { font-size: 2.3rem; line-height: 1; color: var(--gold-2); }
.tile-desc { font-size: .82rem; color: var(--text-2); line-height: 1.5; }
.tile-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--muted); }
.tile.wide { grid-column: 1 / -1; }
.tile.pro-tile { background: linear-gradient(150deg, rgba(214, 178, 106, 0.14), rgba(139, 111, 214, 0.1)); border-color: rgba(214, 178, 106, 0.3); }

/* สี */
.sw { display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); vertical-align: middle; }
.sw.lg { width: 40px; height: 40px; }
.color-pair { display: flex; flex-direction: column; gap: 8px; }
.color-pair div { display: flex; align-items: center; gap: 8px; font-size: .86rem; }
.no { position: relative; }
.no::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; background: var(--bad); transform: rotate(-45deg); border-radius: 2px; }
.color-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.color-row:last-child { border-bottom: none; }
.color-row .txt { flex: 1; min-width: 0; }
.color-row .t1 { font-weight: 600; }
.color-row .t2 { font-size: .82rem; color: var(--muted); }
.color-row.bad .t1 { color: var(--bad); }

/* รายการแบบกลุ่ม */
.list-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 14px; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 15px 16px; border-bottom: 1px solid var(--line); min-height: 64px; }
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--surface-2); }
.list-item .lead { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; color: var(--gold); flex: none; }
.list-item .lead .ic { width: 22px; height: 22px; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .t1 { font-weight: 600; line-height: 1.35; }
.list-item .t2 { font-size: .82rem; color: var(--muted); line-height: 1.4; }
.list-item .chev { color: var(--muted); }

/* เนื้อหาบทความ */
.block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.block:first-child { padding-top: 0; }
.block:last-child { border-bottom: none; padding-bottom: 0; }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.block-head .ic { color: var(--gold); }
.block-head h3 { flex: 1; }
.bullets { margin: 4px 0 0; padding: 0; list-style: none; }
.bullets li { position: relative; padding-left: 22px; margin-bottom: 6px; color: var(--text-2); }
.bullets li::before { content: ''; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.bullets.no-dot li::before { background: var(--bad); }
.chips-static { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips-static span { font-size: .8rem; padding: 3px 11px; border-radius: 999px; background: rgba(102, 199, 154, 0.12); color: #a9e5c6; }
.chips-static.bad span { background: rgba(228, 112, 125, 0.12); color: #f2b0b8; }
.prayer { font-family: var(--serif); font-size: 1.05rem; line-height: 2; color: var(--text); padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); }
.big-num { font-family: var(--serif); font-size: 3.2rem; color: var(--gold-2); line-height: 1; }
.lvl { font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.lvl.l5, .lvl.l4 { background: rgba(102, 199, 154, 0.14); color: #9fe0c0; }
.lvl.l3 { background: rgba(214, 178, 106, 0.14); color: var(--gold-2); }
.lvl.l2, .lvl.l1 { background: rgba(228, 112, 125, 0.14); color: #f2b0b8; }
.letters { font-size: 1.4rem; letter-spacing: 3px; }
.letters .kk { color: var(--bad); text-decoration: underline; text-underline-offset: 6px; }

/* ส่วนล็อก */
.paywall { position: relative; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 14px; border: 1px solid rgba(214, 178, 106, 0.3); background: var(--surface); }
.paywall .ghost { padding: 18px; filter: blur(4px); opacity: .45; pointer-events: none; }
.paywall .ghost i { display: block; height: 10px; border-radius: 5px; background: var(--text-2); margin-bottom: 12px; }
.paywall .ghost i:nth-child(2) { width: 82%; } .paywall .ghost i:nth-child(3) { width: 64%; margin-bottom: 0; }
.paywall .cta { padding: 0 20px 20px; text-align: center; }
.paywall .lock { width: 44px; height: 44px; margin: -6px auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-2); }
.paywall h3 { font-family: var(--serif); font-size: 1.05rem; margin-bottom: 4px; }
.paywall p { font-size: .84rem; }

/* ปุ่ม */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 12px 20px;
  border-radius: var(--r-md); border: none; cursor: pointer; font-size: 1rem; font-weight: 600;
  color: #24190a; background: linear-gradient(180deg, var(--gold-2), var(--gold));
}
.btn:active { transform: scale(.985); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn.subtle { background: var(--surface-2); color: var(--gold-2); }
.btn + .btn { margin-top: 10px; }
.paywall .btn { margin-top: 14px; }

/* ฟอร์ม */
.field { display: block; margin-bottom: 16px; }
.field > span { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 600; margin-bottom: 7px; color: var(--text-2); }
.field > span small { font-weight: 400; color: var(--muted); }
input, select {
  width: 100%; min-height: 54px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); font-size: 1.05rem; font-family: inherit; color-scheme: dark;
}
select option { color: #111; }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
input::placeholder { color: var(--muted); }
.date3 { display: grid; grid-template-columns: 0.8fr 1.5fr 1.15fr; gap: 8px; }
.date3 select { padding: 10px 6px 10px 12px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.seg { display: flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--line); }
.seg button, .seg a { flex: 1; min-height: 46px; border: none; border-radius: 12px; background: transparent; color: var(--text-2); font-size: .95rem; cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px 6px; }
.seg .on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 2px 8px rgba(0, 0, 0, 0.3); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice button { min-height: 64px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: .95rem; line-height: 1.4; }
.choice button small { display: block; color: var(--muted); font-size: .76rem; }
.choice button.on { border-color: var(--gold); background: var(--gold-soft); }

/* ชิปเลื่อนแนวนอน */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 -16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); font-size: .88rem; white-space: nowrap; display: inline-flex; align-items: center; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

/* ฤกษ์และยาม */
.hours { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hour { padding: 9px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: .8rem; color: var(--muted); }
.hour b { display: block; font-size: .92rem; font-weight: 600; color: var(--text-2); }
.hour.good { background: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(214, 178, 106, 0.35); color: var(--gold-2); }
.hour.good b { color: var(--gold-2); }

/* ปฏิทิน */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-h { text-align: center; font-size: .72rem; color: var(--muted); padding-bottom: 4px; }
.cal-day {
  position: relative; aspect-ratio: 1; min-height: 40px; border-radius: 12px; border: none; background: var(--surface-2);
  color: var(--text); font-size: .92rem; cursor: pointer; padding: 0;
}
.cal-day::after { content: ''; position: absolute; left: 50%; bottom: 6px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; }
.cal-day.l5::after, .cal-day.l4::after { background: var(--good); }
.cal-day.l3::after { background: var(--gold); }
.cal-day.l2::after, .cal-day.l1::after { background: var(--bad); }
.cal-day.l5 { background: rgba(102, 199, 154, 0.16); }
.cal-day.fit { background: linear-gradient(160deg, var(--gold-2), var(--gold)); color: #24190a; font-weight: 700; }
.cal-day.fit::after { background: #24190a; }
.cal-day.dim { opacity: .35; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--text); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--gold-2); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: .76rem; color: var(--muted); }
.cal-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }

/* สมาชิก */
.plan {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer;
  padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); margin-bottom: 12px; position: relative;
}
.plan.best { border: 1.5px solid var(--gold); background: linear-gradient(150deg, rgba(214, 178, 106, 0.12), var(--surface)); }
.plan .ptag { position: absolute; top: -11px; left: 16px; }
.plan .price { font-family: var(--serif); font-size: 1.7rem; color: var(--gold-2); white-space: nowrap; line-height: 1.1; text-align: right; }
.plan .price small { display: block; font-family: var(--sans); font-size: .74rem; color: var(--muted); }
.compare { width: 100%; border-collapse: collapse; font-size: .86rem; }
.compare th { font-weight: 600; font-size: .78rem; color: var(--muted); padding: 0 4px 10px; text-align: center; }
.compare th:first-child { text-align: left; }
.compare td { padding: 11px 4px; border-top: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.compare td:not(:first-child) { text-align: center; width: 72px; font-size: .76rem; }
.compare .ic { width: 18px; height: 18px; }
.compare .yes { color: var(--good); } .compare .gold { color: var(--gold-2); } .compare .nope { color: var(--muted); opacity: .5; }
.crown-hero { text-align: center; padding: 10px 0 18px; }
.crown-hero .ic { width: 44px; height: 44px; color: var(--gold); }
.badge-pro { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-2); font-size: .78rem; font-weight: 600; }
.badge-pro .ic { width: 15px; height: 15px; }

/* แถบล่าง */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; justify-content: center;
  background: rgba(13, 10, 22, 0.88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line);
}
.nav .in { display: flex; width: 100%; max-width: 540px; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; min-width: 0; }
.nav a .ic { width: 24px; height: 24px; }
.nav a.on { color: var(--text); }
.nav a.on .ic { color: var(--gold); }

.notice { font-size: .74rem; color: var(--muted); text-align: center; margin: 24px 0 4px; }
.loading { text-align: center; padding: 60px 0; color: var(--muted); }
.fade-in { animation: fade .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } .ring .val { transition: none; } }
@media (max-width: 359px) { .grid2 { grid-template-columns: 1fr; } }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ic.logo { width: 64px; height: 64px; stroke-width: 1.2; }
.ic.lg { width: 34px; height: 34px; stroke-width: 1.4; }
.tile-foot .grow { flex: 1; }
.tile-label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.tile-label .ic { width: 18px; height: 18px; color: var(--gold); }
.notice .ic, p .ic { width: 1.05em; height: 1.05em; }
.ring { width: 92px; height: 92px; }
.color-pair span b { display: block; font-weight: 600; line-height: 1.3; }
.color-pair span small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.tile-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-foot { white-space: nowrap; overflow: hidden; }
.tile-foot > span:last-child { overflow: hidden; text-overflow: ellipsis; }
