/* ONGSÂ — ทุกสไตล์อยู่ในไฟล์นี้ไฟล์เดียว ไม่มี inline style และไม่ดึงจาก CDN
   เพื่อให้ผ่าน CSP `style-src 'self'` / `font-src 'self'` ตาม SPEC §2.4.2

   ชั้นภาพทั้งหมดถอดแบบจาก `AstroConsensus Prototype Color.dc` โดยตรง
   (ค่าสี ระยะ เงา รัศมี ขนาดตัวอักษร ใช้ค่าเดียวกับโปรโตไทป์) */

/* ── fonts (self-hosted · §2.4.2 ห้ามดึงจาก Google Fonts) ───────────── */
@font-face { font-family: 'Chakra Petch'; src: url('./fonts/ChakraPetch-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url('./fonts/ChakraPetch-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url('./fonts/ChakraPetch-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('./fonts/SpaceGrotesk-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #F0E7DD;
  --card: #FDFAF7;
  --white: #FFFFFF;
  --surface: #F4F0EA;
  --surface-2: #F1EDE7;
  --surface-3: #EDE8E1;
  --ink: #241F1B;
  --ink-2: #5C534C;
  --ink-3: #9A8E84;
  --ink-4: #A79C93;
  --ink-mono: #7C7168;
  --hair: #D8CCC0;
  --line: rgba(36, 31, 27, .08);
  --line-2: rgba(36, 31, 27, .06);
  --accent-a: #FF9E33;
  --accent-b: #F2542D;
  --pos: #2F9E68;
  --neg: #D4442C;
  --mid: #E0952B;
  --do: #5F9463;
  --dont: #C4553A;
  --watch: #D9982F;
  --grad-btn: linear-gradient(135deg, #FF9E33, #F2542D);
  --grad-warm: linear-gradient(140deg, #FFF3E2, #FFE9E6);
  --grad-num: linear-gradient(135deg, #FF8A2E, #E23D6B);
  --grad-bar: linear-gradient(90deg, #FFC53A, #FF6B35 60%, #EE5C86);
  --grad-seg: linear-gradient(90deg, #FFC53A, #FF6B35);
  --shadow-card: 0 14px 28px -22px rgba(150, 90, 40, .9);
  --shadow-tile: 0 2px 6px rgba(120, 80, 40, .14);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --sans: 'Chakra Petch', 'Noto Sans Thai', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  --display: 'Space Grotesk', 'Chakra Petch', 'Noto Sans Thai', sans-serif;
}

* { box-sizing: border-box; }
/* ต้องมาก่อน rule ที่ตั้ง display: ไม่งั้น element ที่เป็น flex/grid จะเมิน [hidden] */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: radial-gradient(90% 55% at 50% 0%, #FAF3EA 0%, var(--bg) 70%) fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; text-align: left; }
input { font: inherit; color: inherit; }
a { color: #2a78d6; }
a:hover { color: #1b5aa8; }
code { font-family: var(--mono); font-size: .85em; }

/* ── frame ───────────────────────────────────────────────────────────
   จอเล็ก = เต็มจอจริง · จอใหญ่ = กรอบ 390×844 พร้อมเงา แบบเดียวกับโปรโตไทป์ */
.phone {
  width: 100%; max-width: 390px; margin: 0 auto;
  height: 100vh; height: 100dvh;
  position: relative; overflow: hidden;
  color: var(--ink);
  background: radial-gradient(120% 52% at 50% 0%, #FFE4BC 0%, #FFF2E2 38%, var(--card) 72%);
}
@media (min-width: 440px) and (min-height: 900px) {
  body { display: flex; align-items: flex-start; justify-content: center; padding: 22px 0 40px; }
  .phone { height: 844px; border-radius: 22px; box-shadow: 0 26px 56px -24px rgba(150, 95, 40, .42), 0 0 0 1px rgba(0, 0, 0, .05); }
}

/* ── screens ─────────────────────────────────────────────────────────── */
.screen { display: none; position: absolute; inset: 0; }
.screen.active { display: block; animation: fade .3s ease-out; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
@keyframes sheetUp { from { transform: translateY(100%) } to { transform: translateY(0) } }
@keyframes glow { 0%, 100% { opacity: .30; transform: scale(1) } 50% { opacity: .62; transform: scale(1.045) } }
@keyframes spin { to { transform: rotate(360deg) } }

.pad { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 0 22px; }
.pad.flush { padding: 0; }
.grow { flex: 1; min-height: 10px; }
.sp-110 { height: 110px; flex: none; }
.foot { flex: none; padding-bottom: 28px; display: flex; flex-direction: column; gap: 11px; }
.foot-note { font-size: 12px; color: var(--ink-3); line-height: 1.5; text-align: center; margin: 0; }

/* ── type ────────────────────────────────────────────────────────────── */
.display { font-family: var(--display); font-weight: 600; letter-spacing: -.5px; }
.brand { font-family: var(--display); font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -.5px; margin: 0; }
.tagline { font-size: 15px; color: var(--ink-2); margin: 6px 0 0; }
.mono-label { font-family: var(--mono); font-size: 9px; color: var(--ink-3); letter-spacing: .04em; }
.mono-label.sp { letter-spacing: .5px; }
.ob-title { font-size: 22px; font-weight: 700; line-height: 1.35; margin: 26px 0 0; }
.ob-sub { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 6px 0 0; }
.hint-sm { font-size: 11px; color: var(--ink-4); line-height: 1.5; margin: 0; }
.hint-xs { font-size: 10.5px; color: var(--ink-4); line-height: 1.55; margin: 0; }
.center { text-align: center; }

/* ── welcome ─────────────────────────────────────────────────────────── */
.disc-head { margin-top: 34px; flex: none; }
.disc-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 9px; }
.disc-list li { display: flex; align-items: center; gap: 11px; background: var(--surface); border-radius: 16px; padding: 11px 13px; font-size: 13px; }
.disc-tile { width: 30px; height: 30px; flex: none; background: var(--white); border-radius: 10px; box-shadow: var(--shadow-tile);
  display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 9px; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
  height: 52px; border-radius: 18px; width: 100%; flex: none;
  background: var(--grad-btn); color: #FFF8EE;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
  transition: background .3s ease, color .3s ease, box-shadow .3s ease;
}
/* เงาส้มเฉพาะปุ่มที่มี gate (ob1/ob2) ตาม btnStyle ของโปรโตไทป์ — welcome/ob3 ไม่มีเงา */
.foot.gate .btn-primary:enabled, .ob-foot .btn-primary:enabled {
  box-shadow: 0 14px 26px -16px rgba(242, 84, 45, .9); }
.btn-primary:active { transform: translateY(1px); }
/* ยังไม่กรอกครบ = กดไม่ได้ — สถานะปิดใช้พื้นหุบและเส้นขอบในตัว ไม่ใช้ opacity (โปรโตไทป์ §5.1) */
.btn-primary:disabled { background: #EFEAE3; color: #B5AAA0;
  box-shadow: inset 0 0 0 1.5px rgba(36, 31, 27, .07); cursor: not-allowed; }
.btn-primary:disabled:active { transform: none; }
/* บรรทัดบอกสถานะเหนือปุ่มถัดไป ob1/ob2 */
.gate-note { font-size: 11px; line-height: 1.5; text-align: center; color: var(--ink-4);
  transition: opacity .25s ease; margin: 0; }
.gate-note.ok { color: var(--pos); }
.foot.gate { gap: 9px; }
.btn-ghost { height: 46px; border-radius: 18px; width: 100%; flex: none; background: var(--surface);
  display: flex; align-items: center; justify-content: center; font-size: 14px; }
.btn-soft { height: 42px; border-radius: 14px; width: 100%; flex: none; background: var(--surface);
  display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; }
.btn-clear { height: 48px; flex: none; padding: 0 14px; background: #FBE7E2; color: var(--neg); border-radius: 14px;
  display: flex; align-items: center; font-size: 12px; white-space: nowrap; }

/* ── onboarding shell ────────────────────────────────────────────────── */
.ob-head { display: flex; align-items: center; gap: 12px; padding-top: 22px; flex: none; }
.ob-head .back { font-size: 20px; line-height: 1; padding: 0; width: 24px; }
.prog { flex: 1; display: flex; gap: 5px; }
.prog i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.prog i.on { background: var(--grad-seg); }

.fields { margin-top: 28px; display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.gap9 { gap: 9px; }
.input-row { position: relative; height: 52px; background: var(--surface); border-radius: 16px; display: flex; align-items: center; gap: 10px; padding: 0 14px; }
/* ซ่อนไอคอนของเบราว์เซอร์ แต่ยังกดเปิด native picker ได้ทั้งแถบขวา — เหลือไอคอนของดีไซน์ตัวเดียว */
.input-row input::-webkit-calendar-picker-indicator {
  position: absolute; right: 0; top: 0; width: 48px; height: 52px; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.input-row input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; font-size: 16px; color: var(--ink); cursor: pointer; }
.input-row .ir-icon { font-size: 15px; color: var(--ink-3); pointer-events: none; }
.input-row.off { background: #EFEAE3; opacity: .6; }
.input-row.off input { pointer-events: none; cursor: not-allowed; }

.check-row { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-row .box { width: 20px; height: 20px; flex: none; border-radius: 6px; background: var(--surface-3); color: transparent;
  display: flex; align-items: center; justify-content: center; font-size: 12px; }
.check-row input:checked + .box { background: var(--grad-btn); color: #FFF8EE; }
.check-row .ck-txt { font-size: 12px; color: var(--ink-2); }

/* ob2 — สกรอลล์ได้ พร้อมแถบปุ่มค้างล่าง */
.ob-fixed { flex: none; padding: 22px 22px 16px; display: flex; flex-direction: column; gap: 14px; }
.ob-fixed .ob-title { margin: 0; font-size: 22px; line-height: 1.3; }
.ob-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 22px 16px; display: flex; flex-direction: column; gap: 14px; }
.ob-foot { flex: none; padding: 12px 22px 24px; background: linear-gradient(180deg, rgba(253, 250, 247, 0), var(--card) 45%);
  display: flex; flex-direction: column; gap: 9px; }

.wcard { background: var(--white); border-radius: 20px; padding: 15px; display: flex; flex-direction: column; gap: 11px; box-shadow: var(--shadow-card); }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; height: 48px; border: none; background: var(--surface); border-radius: 14px;
  padding: 0 13px; font-size: 15px; color: var(--ink); outline: none; }
.warm-row { display: flex; align-items: center; gap: 10px; border-radius: 14px; background: var(--grad-warm); padding: 11px 13px; }
.warm-row .wr-txt { font-size: 12.5px; color: var(--ink-2); flex: 1; }
.warm-row .wr-txt.ok { color: var(--pos); }
.num-badge { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--grad-btn); color: #FFF8EE;
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; }

.numpick { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.numpick button { height: 40px; border-radius: 12px; background: var(--surface); font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center; }
.numpick button.on { background: var(--grad-btn); color: #FFF8EE; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface);
  display: flex; align-items: center; font-size: 12.5px; }
.chips button.on { background: var(--grad-btn); color: #FFF8EE; }
.chips button.locked { opacity: .45; cursor: not-allowed; }

/* ob3 — คำชี้แจงการใช้ข้อมูล */
.use-table { margin-top: 20px; background: var(--surface); border-radius: 18px; overflow: hidden; flex: none; }
.use-row { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.use-row:last-child { border-bottom: none; }
.use-row .mono-label { width: 74px; flex: none; padding-top: 2px; }
.use-row span:last-child { font-size: 12.5px; line-height: 1.5; }
.warm-note { margin-top: 18px; display: flex; gap: 10px; align-items: flex-start; background: var(--grad-warm);
  border-radius: 16px; padding: 12px 13px; flex: none; }
.warm-note .em { font-size: 14px; }
.warm-note span:last-child { font-size: 12.5px; line-height: 1.6; }
.soft-note { margin-top: 10px; display: flex; align-items: center; gap: 9px; background: var(--surface-2);
  border-radius: 16px; padding: 12px 13px; flex: none; }
.soft-note .em { font-size: 14px; }
.soft-note span:last-child { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; }

/* ── ceremony (§8.4) ─────────────────────────────────────────────────── */
.ceremony .cer { position: absolute; inset: 0; display: flex; flex-direction: column; cursor: pointer;
  background: radial-gradient(120% 58% at 50% 6%, #FFE0AE 0%, #FFF1DF 44%, var(--card) 100%); }
.cer-top { flex: none; height: 152px; padding: 0 24px; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; }
.cer-head, .cer-date, .cer-badge { opacity: 0; transform: translateY(10px);
  transition: opacity .45s ease-out, transform .45s cubic-bezier(.22, 1, .36, 1); }
.cer-head.on, .cer-date.on, .cer-badge.on { opacity: 1; transform: none; }
.cer-head h2 { font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: -.4px; margin: 0; }
.cer-date { font-family: var(--mono); font-size: 9.5px; color: var(--ink-mono); }

.cer-mid { flex: 0 1 388px; min-height: 0; display: flex; align-items: center; justify-content: center; }
.cer-orb { position: relative; width: min(238px, 62vw); aspect-ratio: 1; }
.cer-glow { position: absolute; inset: -16px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 158, 51, .5), rgba(255, 158, 51, 0) 68%); animation: glow 4s ease-in-out infinite; }
.cer-spin { position: absolute; inset: 12px; border-radius: 50%; border: 1px dashed rgba(36, 31, 27, .16); animation: spin 48s linear infinite; }
.cer-ring { position: absolute; inset: 0; border-radius: 50%; transition: background .34s ease-out;
  background: conic-gradient(from -90deg, var(--stops));
  -webkit-mask: radial-gradient(circle, transparent 63%, #000 64%);
  mask: radial-gradient(circle, transparent 63%, #000 64%); }
.cer-core { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.cer-pct { font-family: var(--display); font-size: 58px; line-height: .9; font-weight: 600; letter-spacing: -2px;
  background: var(--grad-num); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cer-core .mono-label { color: #8A7E74; }
.cer-badge { font-family: var(--mono); font-size: 9px; border-radius: 999px; padding: 4px 11px; margin-top: 2px;
  background: var(--grad-btn); color: #FFF8EE; width: fit-content; }

.cer-voices-wrap { flex: none; height: 186px; padding: 0 24px; display: flex; flex-direction: column; justify-content: center; }
.cer-voices { position: relative; height: 100%; overflow: hidden; }
.cer-voice { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 4px;
  border-radius: 18px; padding: 11px 14px; background: rgba(255, 255, 255, 0); opacity: 0; transform: translateY(16px);
  transition: opacity .6s ease-out, transform .6s cubic-bezier(.22, 1, .36, 1), background .6s ease-out; }
.cer-voice.age0 { opacity: 1; transform: none; background: rgba(255, 255, 255, .78); box-shadow: 0 10px 22px -16px rgba(120, 80, 40, .5); }
.cer-voice.age1 { opacity: .58; transform: translateY(-64px) scale(.975); }
.cer-voice.age2 { opacity: .26; transform: translateY(-128px) scale(.975); }
.cer-voice .vr { display: flex; align-items: center; gap: 9px; }
.cer-voice .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--dot-c); }
.cer-voice .nm { font-size: 14.5px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cer-voice .val { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.cer-voice .txt { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cer-big3 { flex: 1 1 auto; min-height: 0; padding: 0 24px 24px; display: flex; align-items: flex-end; gap: 7px; }
.cer-big3 .b3s { opacity: 0; transform: translateY(10px); transition: opacity .5s ease-out, transform .5s cubic-bezier(.22, 1, .36, 1); }
.cer-big3 .b3s.on { opacity: 1; transform: none; }
.b3s { flex: 1; min-width: 0; border-radius: 12px; padding: 10px 11px; display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border-left: 6px solid var(--mid); }
.b3s.lead { background: var(--grad-warm); }
.b3s.DO { border-left-color: var(--do); }
.b3s.DONT { border-left-color: var(--dont); }
.b3s.WATCH { border-left-color: var(--watch); }
.b3s .tg { font-family: var(--mono); font-size: 8px; }
.b3s.DO .tg { color: var(--do); }
.b3s.DONT .tg { color: var(--dont); }
.b3s.WATCH .tg { color: var(--watch); }
.b3s .lb { font-size: 13px; font-weight: 600; line-height: 1.3; }
.b3s .ln { font-size: 10.5px; color: var(--ink-2); line-height: 1.45; }
/* ในพิธีเปิดวัน การ์ดมีแค่แท็ก+ชื่อธีม — ชื่อธีมใช้ขนาดเดิม */
.cer-big3 .b3s .lb { font-size: 11px; font-weight: 400; line-height: normal; }
.cer-skip { position: absolute; right: 16px; top: 16px; font-family: var(--mono); font-size: 9px; color: var(--ink-2);
  background: rgba(255, 255, 255, .72); border-radius: 999px; padding: 6px 12px; }

/* ── home ────────────────────────────────────────────────────────────── */
.home-scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 100px; display: flex; flex-direction: column; }

.hero { flex: none; position: relative; height: 186px; overflow: hidden; }
.hero .sun { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 50%; transition: all .6s ease; }
.hero .horizon { position: absolute; left: -18%; right: -18%; height: 230px; border-radius: 50% 50% 0 0; transition: all .6s ease; }
.hero.morning .sun { top: 56px; width: 80px; height: 80px; background: radial-gradient(circle at 50% 35%, #FFD24A, #FF8A2E 70%, #F2542D); }
.hero.morning .horizon { top: 112px; background: linear-gradient(180deg, #FFD9A4, #FFF1E0 48%, #FDFAF7 80%); }
.hero.noon .sun { top: 16px; width: 66px; height: 66px; background: radial-gradient(circle at 50% 35%, #FFF3B0, #FFC53A 62%, #FF9E33);
  box-shadow: 0 0 44px 18px rgba(255, 197, 58, .45); }
.hero.noon .horizon { top: 132px; background: linear-gradient(180deg, #FFE9BC, #FFF7EA 46%, #FDFAF7 78%); }
.hero.night .sun { top: 126px; width: 74px; height: 74px; opacity: .9; background: radial-gradient(circle at 50% 35%, #FFB56B, #F2542D 70%, #B93C17); }
.hero.night .horizon { top: 130px; background: linear-gradient(180deg, #C9A0C4, #E7C6C0 40%, #FDFAF7 82%); }
.hero-txt { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.greeting { font-size: 16px; font-weight: 600; }
.hero-txt .mono-label { color: var(--ink-mono); }

.card { flex: none; margin: 14px 16px 0; background: var(--white); border-radius: 18px; box-shadow: var(--shadow-card);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; width: auto; }

.ov-row { display: flex; align-items: center; gap: 9px; }
.ov-pct { font-family: var(--display); font-weight: 600; font-size: 32px; line-height: 1; letter-spacing: -1px; background: var(--grad-num);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.ov-cap { font-size: 12px; color: var(--ink-2); flex: 1; }
.pill { background: var(--surface); border-radius: 999px; padding: 2px 9px; font-size: 10.5px; white-space: nowrap; }
.chev { font-size: 16px; color: var(--ink-4); flex: none; }
.ov-bar { position: relative; height: 13px; border-radius: 8px; background: var(--line); overflow: hidden; }
.ov-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 8px; background: var(--grad-bar);
  transition: width .6s cubic-bezier(.22, 1, .36, 1); }
.ov-bar u { position: absolute; top: 0; bottom: 0; width: 1.5px; background: rgba(250, 248, 244, .7); }
.ov-bar u.dark { background: #c9c2b6; }
.ov-bar u.e55 { left: 55%; }
.ov-bar u.e64 { left: 64%; }
.ov-bar u.e73 { left: 73%; background: #c9c2b6; }
.ov-bar u.e82 { left: 82%; background: #BDB2A8; }
.band-scale { position: relative; height: 26px; }
.band-scale .span { position: absolute; top: 0; height: 3px; background: var(--grad-seg); border-radius: 2px; }
.band-scale .tick { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.band-scale .tick i { width: 1.5px; height: 4px; background: var(--hair); }
.band-scale .tick span { font-family: var(--mono); font-size: 7px; color: #BDB2A8; }
.band-scale .now { position: absolute; top: 13px; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--mono); font-size: 8px; font-weight: 700; color: var(--ink); }

/* การ์ดพลังงาน 5 หมวด + แถบไฮไลต์ รวมเป็นการ์ดเดียว (โปรโตไทป์ 17 ส.ค.) */
.energy-card { flex: none; margin: 18px 16px 0; border-radius: 20px; background: var(--white);
  box-shadow: 0 16px 30px -22px rgba(150, 90, 40, .95); overflow: hidden; cursor: pointer; }
.energy-top { padding: 12px 14px 11px; display: flex; flex-direction: column; gap: 10px; }
.cat-rings { display: flex; justify-content: space-between; align-items: flex-end; }
.cat-rings button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; }
/* วงแหวนสูงเท่ากันทุกวง (กันแถวโยกตอนวงไฮไลต์ใหญ่กว่า) */
.ring-wrap { height: 76px; display: flex; align-items: center; }
.ring { width: 56px; height: 56px; border-radius: 50%; padding: 5px; transition: all .3s ease;
  background: conic-gradient(var(--ring-c) 0 var(--ring-p), rgba(36, 31, 27, .06) var(--ring-p) 100%); }
.ring i { width: 100%; height: 100%; border-radius: 50%; background: var(--card); display: flex; align-items: center;
  justify-content: center; font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--ink-mono); }
.ring.hi { width: 74px; height: 74px; padding: 7px;
  background: conic-gradient(var(--ring-c) 0 var(--ring-p), rgba(36, 31, 27, .10) var(--ring-p) 100%);
  box-shadow: 0 10px 20px -10px var(--ring-glow); }
.ring.hi i { background: #FFF6EA; font-size: 16px; font-weight: 700; color: var(--ink); }
.cat-name { font-size: 10px; color: var(--ink-mono); }
.cat-name.hi { font-size: 10.5px; font-weight: 700; color: var(--ink); }
.energy-hl { background: var(--grad-warm); border-top: 1px solid rgba(36, 31, 27, .07);
  padding: 12px 14px; display: flex; align-items: flex-start; gap: 11px; }
.energy-hl .hl-col { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.energy-hl .hl-head { display: flex; align-items: center; gap: 6px; }
.energy-hl .hl-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--dot-c); }
.energy-hl .hl-name { font-family: var(--mono); font-size: 9px; font-weight: 700; color: #B4601F; letter-spacing: .4px; }
.energy-hl .hl-clause { font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.energy-hl .chev { font-size: 18px; color: #C08B5C; align-self: center; }

.bite-card { flex: none; margin: 14px 16px 0; background: var(--surface); border-radius: 16px; overflow: hidden; }
.bite-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 13px; border-bottom: 1px solid var(--line-2); }
.bite-head .mono-label { color: var(--ink-mono); }
.bite-body { padding: 11px 13px 12px; display: flex; flex-direction: column; gap: 7px; }
.bite-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bite-pair b { font-size: 14.5px; font-weight: 600; }
.bite-pair .x { font-size: 13px; color: var(--ink-3); }
.bite-hint { font-size: 11.5px; color: var(--ink-mono); line-height: 1.45; }
.bite-drink { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.bite-drink .em { font-size: 11px; color: var(--ink-3); }
.bite-drink b { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

/* Big 3 = การ์ด 2 ใบ มีทั้งชื่อธีมและประโยคคำทำนาย §6 บนการ์ด (โปรโตไทป์ 17 ส.ค.) */
.big3 { flex: none; display: flex; gap: 8px; padding: 14px 16px 0; }

.aux-row { display: flex; align-items: center; gap: 9px; }
.aux-row + .aux-row { border-top: 1px solid rgba(36, 31, 27, .07); padding-top: 7px; }
.aux-row .sw { width: 20px; height: 20px; border-radius: 7px; flex: none; background: var(--sw-c); }
.aux-row .nm { font-size: 13.5px; font-weight: 600; flex: 1; }
.aux-row .nm.warn { color: var(--neg); }
.aux-row .why { font-size: 11px; color: var(--ink-3); flex: none; }
.aux-time { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.aux-time b { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.aux-time span { font-size: 11.5px; color: var(--ink-2); }
/* แถวช่วงเลี่ยง ใต้ช่วงทอง (โปรโตไทป์ 17 ส.ค.) */
.aux-time.avoid { border-top: 1px solid rgba(36, 31, 27, .07); padding-top: 7px; }
.aux-time.avoid b { font-size: 15px; color: var(--dont); }

/* §8.5 ไพ่ให้กำลังใจ — พักไว้ ยังไม่ขึ้น production จึงไม่มีสไตล์ .enc-* ในไฟล์นี้ */

/* ── profile ─────────────────────────────────────────────────────────── */
.prof-head { flex: none; display: flex; align-items: center; gap: 13px; padding: 20px 16px 0; }
.avatar { width: 52px; height: 52px; flex: none; border-radius: 18px; background: linear-gradient(140deg, #FFD79A, #FF8A2E);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.ph-txt { display: flex; flex-direction: column; gap: 2px; }
.ph-title { font-size: 16px; font-weight: 600; }
.prof-rows { flex: none; padding: 20px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.prof-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 16px; padding: 12px 13px; width: 100%; }
.prof-row.mt6 { margin-top: 6px; }
/* แถวโฟกัสตอนล็อก — พื้นอุ่นและกดไม่ได้ ตามโปรโตไทป์ */
.prof-row.locked-row { background: var(--grad-warm); cursor: not-allowed; }
.prof-row .pk { font-size: 13px; flex: 1; }
.prof-row .pv { font-size: 13px; color: var(--ink-2); }
.prof-row .lock { font-family: var(--mono); font-size: 8px; border-radius: 999px; padding: 3px 9px; border: 1.5px solid var(--mid); color: var(--mid); }
.prof-row .free { font-family: var(--mono); font-size: 8px; border-radius: 999px; padding: 3px 9px; border: 1.5px solid var(--pos); color: var(--pos); }
.prof-hint { font-size: 11px; color: var(--ink-3); line-height: 1.5; padding: 0 2px; margin: 0; }
.prof-foot { flex: none; padding: 16px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.danger-row { display: flex; align-items: center; background: #FBE7E2; border-radius: 16px;
  padding: 12px 13px; color: var(--neg); font-size: 13px; }
.danger-row span:first-child { flex: 1; }
.contact-note { font-size: 11px; color: var(--ink-4); line-height: 1.6; padding: 0 3px; margin: 0; }

/* ── sheet ───────────────────────────────────────────────────────────── */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(26, 26, 26, .32); z-index: 40; animation: fade .18s ease; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86%; z-index: 50;
  background: var(--card); border-radius: 22px 22px 0 0; display: flex; flex-direction: column;
  animation: sheetUp .26s cubic-bezier(.2, .8, .25, 1); }
.sheet-grip { width: 44px; height: 4px; border-radius: 3px; background: var(--hair); margin: 12px auto 0; flex: none; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 18px 96px; display: flex; flex-direction: column; gap: 13px; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.sheet-head h3 { font-size: 17px; font-weight: 700; margin: 0; flex: 1; }
.sheet-head .mono-label { flex: none; }

.el-chips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.el-chips .k { font-family: var(--mono); font-size: 9px; color: var(--ink-3); flex: none; }
.el-chip { background: var(--surface); border-radius: 999px; padding: 3px 11px; font-size: 11.5px; color: var(--ink-2); }
.el-chip.top { background: var(--grad-btn); color: #FFF8EE; font-weight: 600; }
.el-chip.zero { color: var(--ink-4); }
/* แถวธีมซ้อน ใต้แถวธาตุเด่น (โปรโตไทป์ 17 ส.ค.) */
.ov-themes { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ov-themes .k { font-family: var(--mono); font-size: 9px; color: var(--ink-3); flex: none; }
.ov-themes .val { border-radius: 999px; background: var(--ink); color: var(--card); padding: 3px 11px;
  font-family: var(--mono); font-size: 11px; }
.ov-themes .t { border-radius: 999px; background: var(--surface); padding: 3px 11px; font-size: 11.5px; color: var(--ink-2); }

.why-card { background: var(--grad-warm); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.why-card p { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); margin: 0; }

.disc-scroll { display: flex; flex-direction: column; gap: 9px; }
.dd { background: var(--surface); border-radius: 16px; padding: 9px 12px; display: flex; flex-direction: column; gap: 5px; }
.dd-head { display: flex; align-items: center; gap: 8px; }
.dd-name { font-size: 13px; font-weight: 600; flex: 1; }
.dd-el { font-family: var(--mono); font-size: 9px; border: 1px solid var(--hair); border-radius: 999px; padding: 2px 8px; }
.dd-val { font-family: var(--mono); font-size: 11px; }
.dd-bar { height: 7px; border-radius: 4px; background: var(--line); position: relative; }
.dd-bar i { position: absolute; top: 0; bottom: 0; width: var(--w); border-radius: 4px; }
.dd-bar i.pos { left: 50%; background: var(--pos); }
.dd-bar i.neg { right: 50%; background: var(--neg); }
.dd-bar u { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1.5px; background: #BDB2A8; }
.dd-sub { font-family: var(--mono); font-size: 9px; color: var(--ink-3); line-height: 1.5; }

.cat-top { display: flex; align-items: center; gap: 16px; }
.ring-lg { width: 96px; height: 96px; flex: none; border-radius: 50%; padding: 8px;
  background: conic-gradient(var(--ring-c) 0 var(--ring-p), rgba(36, 31, 27, .08) var(--ring-p) 100%); }
.ring-lg i { width: 100%; height: 100%; border-radius: 50%; background: var(--card); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-style: normal; }
.ring-lg .pc { font-family: var(--display); font-size: 26px; line-height: 1; font-weight: 600; letter-spacing: -1px; }
.ring-lg .bd { font-family: var(--mono); font-size: 8px; color: var(--ink-3); }
.cat-side { display: flex; flex-direction: column; gap: 7px; }
.tag { font-family: var(--mono); font-size: 8px; border: 1px solid rgba(36, 31, 27, .14); border-radius: 999px;
  padding: 3px 8px; align-self: flex-start; color: var(--ink-2); }
.tag.hi { background: var(--grad-btn); color: #FFF8EE; border-color: transparent; }
.cat-side .note { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.clause-card { background: var(--surface); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.clause-open { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); font-style: italic; margin: 0; }
.clause-main { font-size: 15px; line-height: 1.6; margin: 0; }
.vote { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 9px 11px;
  border-top: 1.5px solid rgba(36, 31, 27, .10); border-right: 1.5px solid rgba(36, 31, 27, .10);
  border-bottom: 1px solid var(--line-2); border-left: 5px solid var(--mid); }
.vote.pos { border-left-color: var(--pos); }
.vote.neg { border-left-color: var(--neg); }
.vote .vn { font-size: 12.5px; flex: 1; }
.vote .vv { font-family: var(--mono); font-size: 10px; }
.theme-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.theme-chips span { background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 11.5px; }
.sheet-col { display: flex; flex-direction: column; gap: 8px; }
.sheet-close { height: 48px; border-radius: 18px; background: var(--surface); display: flex; align-items: center;
  justify-content: center; font-size: 14px; margin-top: 4px; }
.opt { display: flex; align-items: center; gap: 10px; border-radius: 16px; padding: 12px 13px; background: var(--surface); }
.opt .ol { font-size: 14px; flex: 1; }
.opt.on { background: var(--grad-btn); color: #FFF8EE; }
.opt.locked { opacity: .45; cursor: not-allowed; }

/* ── nav ─────────────────────────────────────────────────────────────── */
.nav { position: absolute; left: 74px; right: 74px; bottom: 16px; display: flex; gap: 4px; padding: 6px;
  border-radius: 26px; overflow: hidden; z-index: 30;
  background: rgba(253, 250, 247, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 14px 30px -14px rgba(120, 80, 40, .45), 0 0 0 1px rgba(0, 0, 0, .04); }
.nav button { position: relative; z-index: 1; flex: 1; height: 44px; border-radius: 20px; display: flex;
  align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; color: var(--ink-3); transition: color .3s ease; }
.nav button.on { color: #FFF8EE; }
.nav-ind { position: absolute; top: 6px; bottom: 6px; width: calc(50% - 8px); left: 6px; border-radius: 20px;
  background: var(--grad-btn); box-shadow: 0 8px 16px -8px rgba(242, 84, 45, .7);
  transition: left .42s cubic-bezier(.4, 1.25, .4, 1); }
.nav-ind.right { left: calc(50% + 2px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
