/* ===============================================================
   หน้าตาของเว็บ (ธีมมืด สไตล์แอปออกกำลังกาย)
   สีหลักทั้งหมดอยู่ใน :root แก้ตรงนี้ที่เดียว ทั้งเว็บจะเปลี่ยนตาม
   =============================================================== */
:root {
  /* layout: แอปมือถือ — หัวด้านบน, เนื้อหาเป็นการ์ดคอลัมน์เดียว, แถบเมนูติดด้านล่าง */
  --bg: #0d0e1a;
  --surface: #171829;
  --surface2: #212340;
  --ink: #f3f3f8;
  --muted: #9b9dbb;
  --line: #2b2d4a;
  --hot: #ff5d5d;       /* สีหลัก: ชมพูปะการัง */
  --hot2: #ff9d3d;      /* ส้ม ใช้คู่กับสีหลักเป็นไล่สี */
  --cool: #4fd6ff;      /* โปรตีน */
  --violet: #a98bff;    /* คาร์บ */
  --sun: #ffd166;       /* ไขมัน */
  --good: #3ddc97;
  --warn: #ffb547;
  --bad: #ff5c7a;
  --display: "Prompt", "IBM Plex Sans Thai", system-ui, sans-serif;
  --body: "IBM Plex Sans Thai", system-ui, sans-serif;
  --radius: 20px;
  --prop: #464a72;
  --glass: rgba(13, 14, 26, .86);
  --glass2: rgba(23, 24, 41, .94);
  --on-ink: #0d0e1a;
  color-scheme: dark;
}

/* ---------- ธีม (เลือกได้ในหน้า "ฉัน") ---------- */
[data-theme="light"] {
  --bg: #f4f5f9; --surface: #ffffff; --surface2: #eef0f6; --ink: #161827; --muted: #6a6e86; --line: #dfe2ec;
  --hot: #ff4f5e; --hot2: #ff8a3d; --cool: #0a9ed6; --violet: #7c5cf0; --sun: #e0a100;
  --good: #14a46c; --warn: #d98a00; --bad: #e23d5d; --prop: #c5c9da;
  --glass: rgba(243, 244, 248, .88); --glass2: rgba(255, 255, 255, .94); --on-ink: #ffffff; color-scheme: light;
}
[data-theme="sakura"] {
  --bg: #fff6f8; --surface: #ffffff; --surface2: #fcedf2; --ink: #33192a; --muted: #8e6577; --line: #f3dbe4;
  --hot: #f2508a; --hot2: #ff9a76; --cool: #3a9fd0; --violet: #9b72ee; --sun: #eda100;
  --good: #1fa974; --warn: #df8400; --bad: #dc2f5c; --prop: #efc3d2;
  --glass: rgba(255, 246, 248, .82); --glass2: rgba(255, 255, 255, .86); --on-ink: #ffffff; color-scheme: light;
}
[data-theme="ocean"] {
  --bg: #071a24; --surface: #0e2733; --surface2: #153543; --ink: #e8f6fb; --muted: #8fb3c2; --line: #1d4252;
  --hot: #19c3d9; --hot2: #5ef0c8; --cool: #7fb8ff; --violet: #b39dff; --sun: #ffd166; --prop: #2c5a6c;
  --glass: rgba(7, 26, 36, .88); --glass2: rgba(14, 39, 51, .94); --on-ink: #071a24;
}
[data-theme="forest"] {
  --bg: #0e1712; --surface: #16231b; --surface2: #1f3126; --ink: #eef5ee; --muted: #9db4a3; --line: #2a4031;
  --hot: #3fcf8e; --hot2: #c6e86a; --cool: #5fc8ff; --violet: #b39dff; --sun: #ffd166; --prop: #355a42;
  --glass: rgba(14, 23, 18, .88); --glass2: rgba(22, 35, 27, .94); --on-ink: #0e1712;
}
[data-theme="sunset"] {
  --bg: #1a0f24; --surface: #251634; --surface2: #321f45; --ink: #fbf1ff; --muted: #b9a2c9; --line: #3d2856;
  --hot: #ff6aa2; --hot2: #ffb35c; --cool: #6fd3ff; --violet: #c49bff; --sun: #ffd166; --prop: #5a3f78;
  --glass: rgba(26, 15, 36, .88); --glass2: rgba(37, 22, 52, .94); --on-ink: #1a0f24;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
a { color: var(--cool); }

/* ---------- หัวด้านบน ---------- */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar-in { max-width: 640px; margin: 0 auto; padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: .2px;
  background: linear-gradient(90deg, var(--hot), var(--hot2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sync { font-size: 12px; color: var(--muted); }
.sync[data-state="error"], .sync[data-state="slow"] { color: var(--warn); }

/* ---------- แถบเมนูด้านล่าง ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: rgba(23, 24, 41, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); background: var(--glass2); }
.tabbar-in { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 500; }
.tabbar svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--ink); }
.tabbar a.active svg { stroke: var(--hot); }

/* ---------- โครงหน้า ---------- */
.wrap { max-width: 640px; margin: 0 auto; padding: 6px 16px 110px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card.flat { background: transparent; padding: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }



/* ---------- วงแหวนแคล ---------- */
.ring-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: center; }
.ring { position: relative; width: 170px; height: 170px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring .big { font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ring .lbl { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ring.over .big { color: var(--bad); }
.macros { display: flex; flex-direction: column; gap: 12px; }
.macro .top { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.macro .top b { font-weight: 600; }
.macro .track { height: 8px; border-radius: 99px; background: var(--surface2); overflow: hidden; margin-top: 5px; }
.macro .fill { height: 100%; border-radius: 99px; }
.ring-meta { display: flex; justify-content: space-around; text-align: center; font-variant-numeric: tabular-nums; }
.ring-meta b { display: block; font-family: var(--display); font-size: 17px; }
.ring-meta span { font-size: 12px; color: var(--muted); }

/* ---------- ตัวเลขสรุป ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.tile { background: var(--surface2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile span { font-size: 12px; color: var(--muted); }
.tile b { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.tile small { color: var(--muted); font-size: 12px; }

/* ---------- ปุ่มและฟอร์ม ---------- */
button { font: inherit; font-weight: 600; cursor: pointer; border-radius: 99px; padding: 10px 18px; border: 0; color: #fff;
  background: linear-gradient(90deg, var(--hot), var(--hot2)); }
button.ghost { background: var(--surface2); color: var(--ink); }
button.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
button.icon { white-space: nowrap; padding: 6px 12px; background: var(--surface2); color: var(--ink); font-weight: 500; }
button.wide { width: 100%; padding: 13px; font-size: 16px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--cool); outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface2); border: 1px solid transparent; border-radius: 12px; padding: 11px 13px; min-width: 0; }
textarea { resize: vertical; min-height: 74px; }
input:focus, select:focus, textarea:focus { border-color: var(--hot); outline: none; }

/* ---------- ชิป ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.wrapchips { flex-wrap: wrap; overflow: visible; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font-size: 13.5px; padding: 7px 14px; border-radius: 99px; background: var(--surface2); color: var(--ink); font-weight: 500; }
.chip.on { background: var(--ink); color: var(--on-ink); }
.tag { font-size: 11.5px; padding: 2px 9px; border-radius: 99px; background: var(--surface2); color: var(--muted); font-weight: 500; white-space: nowrap; }
.tag.machine, .tag.cable { color: var(--cool); background: rgba(79, 214, 255, .12); }
.tag.dumbbell { color: var(--hot2); background: rgba(255, 157, 61, .13); }
.badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 93, 93, .14); color: var(--hot); border-radius: 99px; padding: 5px 12px; font-weight: 600; font-size: 13px; }

/* ---------- ข้อความแจ้งเตือน ---------- */
.notes { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.note { padding: 10px 14px; border-radius: 14px; font-size: 14px; background: var(--surface2); border-left: 4px solid var(--muted); }
.note.good { border-color: var(--good); }
.note.warn { border-color: var(--warn); }
.note.bad { border-color: var(--bad); }
.note.info { border-color: var(--cool); }

/* ---------- รายการอาหาร ---------- */
.meal-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface2); border-radius: 14px; padding: 10px 12px; }
.item .main { display: flex; flex-direction: column; min-width: 0; }
.item .name { font-weight: 500; }
.item .kcal { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 4px; flex: none; }
.qty b { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.qty button { width: 30px; height: 30px; padding: 0; background: var(--surface); color: var(--ink); }
.pend input { width: 84px; padding: 7px 9px; text-align: right; }
.option { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface2); border-radius: 14px; padding: 12px 14px; }
.option .kcal { color: var(--hot2); }
.ai-box { white-space: pre-wrap; background: linear-gradient(135deg, rgba(255, 93, 93, .12), rgba(169, 139, 255, .12)); border-radius: 14px; padding: 14px; font-size: 14px; }

/* ---------- ตารางฝึก ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: 99px; padding: 4px; }
.seg button { background: transparent; color: var(--muted); padding: 9px; }
.seg button.on { background: var(--surface2); color: var(--ink); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 0 8px; border-radius: 14px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; }
.wd i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.wd.train i { background: var(--hot); }
.wd.today { color: var(--ink); }
.wd.on { background: var(--ink); color: var(--on-ink); }
.progress { height: 8px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--hot), var(--hot2)); border-radius: 99px; }
.ex { background: var(--surface); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.ex.done { opacity: .6; }
.ex-top { display: grid; grid-template-columns: 112px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; cursor: pointer; }
.ex-fig { position: relative; background: var(--surface2); border-radius: 14px; aspect-ratio: 4 / 3; }
.ex-num { position: absolute; top: 5px; left: 5px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ex-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ex-info b { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.25; }
.ex-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.check { width: 40px; height: 40px; border-radius: 50%; padding: 0; background: var(--surface2); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.check svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.check.on { background: var(--good); color: var(--bg); }
.ex-detail { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.ex-detail .bigfig { background: var(--surface2); border-radius: 16px; }
.fig { width: 100%; height: auto; display: block; }
.fig .lb { stroke: var(--ink); stroke-width: 6; stroke-linecap: round; }
.fig .bk .lb { opacity: .35; }
.fig .hd { fill: var(--ink); }
.fig .gr { stroke: var(--line); stroke-width: 2; }
.fig .pr { fill: var(--prop); }
.fig .prl { stroke: var(--prop); stroke-width: 4; }
.fig .mc { fill: var(--cool); stroke: var(--cool); }
.fig .cb { stroke: var(--cool); stroke-width: 1.5; }
.fig .dbh { stroke: var(--hot2); stroke-width: 3; }
.fig .dbp { fill: var(--hot2); }
.fig .bbp { fill: var(--surface); stroke: var(--hot2); stroke-width: 4; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lib-card { background: var(--surface); border-radius: 18px; padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.lib-card .ex-fig { aspect-ratio: 4 / 3; }
.lib-card b { font-family: var(--display); font-weight: 600; font-size: 14.5px; padding: 0 4px; line-height: 1.3; }
.lib-card .row { padding: 0 4px; gap: 4px; }
.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { background: var(--surface); width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }

/* ---------- กราฟ ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--body); }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.table-wrap { overflow-x: auto; }

@media (max-width: 420px) {
  .ring-wrap { grid-template-columns: 1fr; justify-items: center; }
  .macros { width: 100%; }
  .ex-top { grid-template-columns: 96px 1fr auto; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }

/* ---------- ส่วนเพิ่มเติม ---------- */
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg.four button { padding: 9px 2px; font-size: 13.5px; }
.hero { background: linear-gradient(135deg, var(--hot), var(--hot2)); color: #fff; border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.hero h1 { color: #fff; }
.hero p { color: rgba(255, 255, 255, .9); }
.hero .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; z-index: 1; }
.hero .stats div { background: rgba(255, 255, 255, .18); border-radius: 14px; padding: 10px; }
.hero .stats b { display: block; font-family: var(--display); font-size: 21px; }
.hero .stats span { font-size: 12px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick a { background: var(--surface); border-radius: 16px; padding: 12px 4px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; text-align: center; }
.quick svg { width: 24px; height: 24px; stroke: var(--hot); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card, .ex, .lib-card, .quick a { transition: transform .15s ease; }
.lib-card:active, .quick a:active, .ex-top:active { transform: scale(.98); }
.sets { display: flex; flex-direction: column; gap: 8px; }
.setrow { display: grid; grid-template-columns: 52px 1fr 1fr; gap: 8px; align-items: center; }
.setrow span { font-size: 13px; color: var(--muted); }
.setrow input { padding: 9px 10px; text-align: center; }
.target { border-radius: 14px; padding: 12px 14px; background: var(--surface2); display: flex; flex-direction: column; gap: 3px; }
.target b { font-family: var(--display); font-weight: 600; }
.target.up { background: color-mix(in srgb, var(--good) 18%, var(--surface2)); }
.target.up b { color: var(--good); }
.target.down b { color: var(--warn); }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.pill.up { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.pill.down { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.prog-card { background: var(--surface); border-radius: 18px; padding: 14px; display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; cursor: pointer; }
.prog-card b { font-family: var(--display); font-weight: 600; }
.spark { width: 110px; height: 40px; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-btn { border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; color: var(--ink); background: var(--surface2); border: 2px solid transparent; font-weight: 500; font-size: 13px; }
.theme-btn.on { border-color: var(--hot); }
.theme-btn .sw { display: flex; gap: 4px; }
.theme-btn .sw i { width: 18px; height: 18px; border-radius: 50%; display: block; border: 1px solid rgba(0, 0, 0, .1); }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink); font-size: 14px; flex-direction: row; }
.toggle input { width: 46px; height: 26px; appearance: none; -webkit-appearance: none; background: var(--surface2); border-radius: 99px; position: relative; cursor: pointer; padding: 0; flex: none; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: .2s; }
.toggle input:checked { background: var(--hot); }
.toggle input:checked::after { left: 23px; background: #fff; }
input[type="color"] { padding: 2px; width: 52px; height: 40px; border-radius: 10px; }
.minutes { display: flex; align-items: center; gap: 10px; }
.minutes input { width: 90px; text-align: center; font-size: 20px; font-family: var(--display); }
.ideas { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- แผนที่กล้ามเนื้อ ---------- */
.bodymap { width: 100%; height: auto; display: block; }
.bodymap .bm-sil { fill: var(--surface2); }
.bodymap .bm-o { fill: color-mix(in srgb, var(--muted) 22%, var(--surface2)); }
.bodymap .bm-s { fill: color-mix(in srgb, var(--hot) 45%, var(--surface2)); }
.bodymap .bm-p { fill: var(--hot); }
.bodymap .bm-t { fill: var(--muted); font-size: 7px; text-anchor: middle; font-family: var(--body); }
.muscle-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; background: var(--surface2); border-radius: 14px; padding: 10px; }
.muscle-row .bodymap .bm-sil { fill: var(--surface); }
.mchips { display: flex; flex-wrap: wrap; gap: 4px; }
.mchip { font-size: 11.5px; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--hot) 14%, transparent); color: var(--muted); white-space: nowrap; }
.mchip.p { background: var(--hot); color: #fff; font-weight: 600; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 3px 0 6px; vertical-align: middle; }
.dot.p { background: var(--hot); } .dot.s { background: color-mix(in srgb, var(--hot) 45%, var(--surface2)); }

.ex-fig { position: relative; }
/* ---------- บันทึกรายวัน ---------- */
.seg.five { grid-template-columns: repeat(5, 1fr); }
.seg.five button { padding: 9px 0; font-size: 12.5px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-d { background: var(--surface); color: var(--muted); border-radius: 12px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; gap: 1px; font-weight: 500; font-size: 11px; }
.cal-d b { font-size: 15px; color: var(--ink); font-family: var(--display); }
.cal-d i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.cal-d.has i { background: var(--hot); } .cal-d.cardio:not(.has) i { background: var(--cool); }
.cal-d.on { background: var(--ink); } .cal-d.on b, .cal-d.on span { color: var(--on-ink); }
/* ---------- ตั้งค่า / โปรแกรม ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.steps i { height: 6px; border-radius: 99px; background: var(--surface2); }
.steps i.on { background: linear-gradient(90deg, var(--hot), var(--hot2)); }
.choices { display: grid; gap: 8px; }
.choices.two { grid-template-columns: 1fr 1fr; } .choices.three { grid-template-columns: repeat(3, 1fr); }
.choice { background: var(--surface2); color: var(--ink); border: 2px solid transparent; border-radius: 14px; padding: 12px 14px; text-align: left; display: flex; flex-direction: column; gap: 2px; font-weight: 500; }
.choice b { font-weight: 600; } .choice span { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.choice.on { border-color: var(--hot); background: color-mix(in srgb, var(--hot) 12%, var(--surface2)); }
.prog { background: var(--surface2); border: 2px solid transparent; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.prog.on { border-color: var(--hot); }
.prog-top { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; }
.prog .bodymap .bm-sil { fill: var(--surface); }
/* ---------- ตัวเลือกท่าแบบมีภาพ ---------- */
.bodyparts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bp { background: var(--surface2); color: var(--ink); border-radius: 14px; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 500; border: 2px solid transparent; min-height: 44px; justify-content: center; }
.bp .bodymap { width: 54px; } .bp .bodymap .bm-sil { fill: var(--surface); } .bp .bm-t { display: none; }
.bp.on { border-color: var(--hot); }
.picks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pick { display: grid; grid-template-columns: 92px 1fr 54px; gap: 10px; align-items: center; background: var(--surface2); border-radius: 16px; padding: 8px; cursor: pointer; }
.pick .ex-fig { background: var(--surface); border-radius: 12px; aspect-ratio: 4 / 3; }
.pick-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pick-info b { font-family: var(--display); font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.pick-map .bodymap .bm-sil { fill: var(--surface); } .pick-map .bm-t { display: none; }
.photo-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--surface2); color: var(--ink); border-radius: 99px; padding: 11px; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.photo-btn svg { width: 20px; height: 20px; stroke: var(--hot); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scan-grid label input { padding: 8px 10px; }

.scan-grid label { min-width: 0; } .scan-grid input { width: 100%; }

.pend-card { background: var(--surface2); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.pend-card .q { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.pend-card .q .chip { background: var(--surface); }

.fig .fnb { fill: var(--surface); opacity: .92; } .fig .fnt { fill: var(--ink); font-size: 9.5px; font-family: var(--body); font-weight: 600; }

.comp { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.comp li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.comp li:last-child { border-bottom: 0; }
.c-label { font-size: 14px; }
.c-val { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; justify-content: flex-end; text-align: right; }
.c-val b { font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; }
.c-val small { color: var(--muted); }
.pill.bad { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--bad); }
.delta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }

.comp li { flex-wrap: wrap; }
.c-info { flex-basis: 100%; background: var(--surface2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.walk-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.walk-n { font-family: var(--display); font-size: 30px; font-variant-numeric: tabular-nums; }
.walk-meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); } .walk-meta b { color: var(--ink); font-size: 16px; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 80px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 11px; color: var(--muted); }
.bar-v { width: 70%; background: var(--surface2); border-radius: 6px 6px 3px 3px; }
.bar-v.hit { background: linear-gradient(180deg, var(--hot2), var(--hot)); }

/* ---------- ปรับหน้าตา ---------- */
:root { --shadow: none; }
[data-theme="light"], [data-theme="sakura"] { --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.05); }
.card, .ex, .lib-card, .prog-card, .quick a { box-shadow: var(--shadow); }
.card h2 { letter-spacing: .1px; }
.remind { display: block; background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--ink); border-radius: 16px; padding: 12px 14px; font-size: 14px; text-decoration: none; border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }

.start-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px; font-size: 17px; }
.start-btn span { font-size: 12px; font-weight: 500; opacity: .9; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.bdg { background: var(--surface2); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 4px; opacity: .7; }
.bdg.got { opacity: 1; background: color-mix(in srgb, var(--hot) 14%, var(--surface2)); }
.bdg .bi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); border: 1.5px dashed var(--line); margin-bottom: 4px; }
.bdg .bi svg { width: 22px; height: 22px; }
.bdg.got .bi { color: #fff; border: 0; background: linear-gradient(135deg, var(--hot), var(--hot2)); box-shadow: 0 4px 12px color-mix(in srgb, var(--hot) 35%, transparent); }
.bdg b { font-size: 14px; font-family: var(--display); font-weight: 600; }
.week-card .tiles { grid-template-columns: repeat(3, 1fr); }
.week-card .tile b { font-size: 19px; }

/* ---------- โหมดฝึก ---------- */
.session { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto; }
.session-in { max-width: 640px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 18px calc(30px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.session-top { position: sticky; top: 0; background: var(--bg); padding: 6px 0; z-index: 2; }
.ph { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--surface2); color: var(--muted); font-weight: 600; }
.ph.on { background: linear-gradient(90deg, var(--hot), var(--hot2)); color: #fff; } .ph.done { color: var(--good); }
.dots { display: flex; gap: 5px; } .dots i { flex: 1; height: 5px; border-radius: 99px; background: var(--surface2); }
.dots i.done { background: var(--good); } .dots i.on { background: var(--hot); }
.ex-fig.big { background: var(--surface); border-radius: 20px; aspect-ratio: 4 / 3; }
.wk-target { text-align: center; } .wk-target b { font-family: var(--display); font-size: 28px; }
.set-now { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.set-now input { font-size: 22px; text-align: center; font-family: var(--display); padding: 12px; }
.setlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.setlist li { display: grid; grid-template-columns: 70px 1fr 24px; gap: 8px; padding: 10px 14px; background: var(--surface); border-radius: 12px; font-variant-numeric: tabular-nums; }
.setlist li.ok { color: var(--good); } .setlist li.now { outline: 2px solid var(--hot); }
.timer { display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--surface); border-radius: 20px; padding: 18px; }
.timer-ring { position: relative; width: 170px; height: 170px; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tr-bg { fill: none; stroke: var(--surface2); stroke-width: 10; }
.tr-fg { fill: none; stroke: var(--hot); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.timer-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-c b { font-family: var(--display); font-size: 40px; font-variant-numeric: tabular-nums; } .timer-c span { font-size: 12.5px; color: var(--muted); }
.done-hero { background: linear-gradient(135deg, var(--hot), var(--hot2)); color: #fff; border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 4px; }
.done-hero b { font-family: var(--display); font-size: 26px; }

.clip { display: inline-flex; align-items: center; gap: 6px; align-self: center; margin: 2px auto 10px; padding: 8px 16px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.clip:active { transform: scale(.97); }

.subs { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 6px; }
.sub { background: var(--surface2); border-left: 3px solid var(--hot); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.sub b { font-size: 14px; }
.sub-chips .chip { font-size: 12.5px; padding: 5px 11px; }

/* ===============================================================
   หน้าตาเวอร์ชัน 2: ผิวการ์ดมีมิติ, เมนูลอย, ปุ่มเด้ง, ภาพเคลื่อนไหว
   =============================================================== */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --edge: rgba(255, 255, 255, .06);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 18px 40px -14px rgba(0, 0, 0, .6);
  --glow: color-mix(in srgb, var(--hot) 55%, transparent);
}
[data-theme="light"], [data-theme="sakura"] {
  --edge: color-mix(in srgb, var(--line) 75%, transparent);
  --shadow: 0 1px 2px rgba(60, 20, 40, .04), 0 8px 24px -10px rgba(60, 20, 40, .12);
  --shadow-lg: 0 20px 44px -16px rgba(60, 20, 40, .28);
  --glow: color-mix(in srgb, var(--hot) 45%, transparent);
}

/* พื้นหลังมีแสงสีจางๆ ให้หน้าดูมีมิติ */
body { -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: -10% -10% auto; height: 70vh; z-index: -1; pointer-events: none;
  background: radial-gradient(45% 55% at 92% 0%, color-mix(in srgb, var(--hot) 20%, transparent), transparent 70%),
              radial-gradient(40% 50% at 0% 18%, color-mix(in srgb, var(--hot2) 14%, transparent), transparent 70%); }
html.locked { overflow: hidden; }

/* หัวด้านบน */
.topbar { background: var(--glass); border-bottom: 1px solid transparent; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; }
.logo { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--hot), var(--hot2)); box-shadow: 0 4px 12px -3px var(--glow); }
.logo svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.sync { padding: 3px 10px; border-radius: 99px; background: var(--surface2); }
.sync:empty { display: none; }

/* ตัวอักษร */
h1 { font-size: 28px; letter-spacing: -.2px; }
.wrap > h1:first-child, .wrap > .spread:first-child h1 { padding: 6px 2px 0; }

/* การ์ด */
.card { border: 1px solid var(--edge); box-shadow: var(--shadow); border-radius: 24px; }
.card.flat { border: 0; box-shadow: none; }
.card h2 { font-size: 17px; }
.ex, .lib-card, .prog-card, .quick a, .cal-d, .wd { border: 1px solid var(--edge); box-shadow: var(--shadow); }
.lib-card, .prog-card, .quick a, .pick, .option, .choice, .prog, .bdg, .item { transition: transform .25s var(--ease-spring), box-shadow .25s ease, background .2s ease, border-color .2s ease; }
@media (hover: hover) {
  .lib-card:hover, .prog-card:hover, .quick a:hover, .pick:hover, .prog:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  button:not(:disabled):hover { filter: brightness(1.06); }
}

/* ปุ่ม */
button { transition: transform .22s var(--ease-spring), box-shadow .25s ease, filter .2s ease, background .2s ease, color .2s ease;
  box-shadow: 0 8px 18px -8px var(--glow); position: relative; }
button:not(:disabled):active { transform: scale(.95); }
button.ghost, button.icon, button.danger, .chip, .seg button, .check, .qty button, .choice, .bp, .theme-btn, .wd, .ph, .clip { box-shadow: none; }
button.ghost { border: 1px solid var(--edge); }
button.wide { border-radius: 18px; padding: 15px; }
.start-btn { border-radius: 22px; padding: 16px; background-size: 200% 100%; background-image: linear-gradient(90deg, var(--hot), var(--hot2), var(--hot)); animation: sheen 5s linear infinite; }
@keyframes sheen { to { background-position: -200% 0; } }
.lib-card:active, .quick a:active, .ex-top:active, .pick:active, .option:active, .choice:active, .prog:active, .wd:active, .cal-d:active, .bp:active { transform: scale(.97); }

/* ช่องกรอก */
input, select, textarea { border: 1px solid var(--edge); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--hot); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hot) 18%, transparent); }

/* ชิป / แท็บย่อย */
.chip { border: 1px solid var(--edge); transition: background .2s ease, color .2s ease, transform .22s var(--ease-spring); }
.chip.on { box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .5); border-color: transparent; }
.seg { background: var(--surface2); border: 1px solid var(--edge); }
.seg button { transition: color .2s ease, background .25s ease; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 2px 10px -3px rgba(0, 0, 0, .25); }
.wd { transition: transform .22s var(--ease-spring), background .2s ease; }
.wd.on { background: linear-gradient(160deg, var(--hot), var(--hot2)); color: #fff; box-shadow: 0 8px 18px -8px var(--glow); border-color: transparent; }
.wd.on i { background: #fff; }
.wd.today:not(.on) { border-color: var(--hot); }
.cal-d.on { background: linear-gradient(160deg, var(--hot), var(--hot2)); border-color: transparent; }
.cal-d.on b, .cal-d.on span { color: #fff; }

/* การ์ดต้อนรับ */
.hero { border-radius: 28px; padding: 22px; box-shadow: 0 18px 40px -16px var(--glow);
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--hot2) 85%, transparent) 0%, transparent 60%),
              linear-gradient(140deg, var(--hot), color-mix(in srgb, var(--hot) 70%, var(--violet))); }
.hero::after { width: 220px; height: 220px; right: -70px; top: -90px; background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 65%); animation: float 9s ease-in-out infinite; }
.hero::before { content: ""; position: absolute; left: -60px; bottom: -80px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 65%); animation: float 11s ease-in-out infinite reverse; }
@keyframes float { 50% { transform: translate(-14px, 12px) scale(1.06); } }
.hero > * { position: relative; z-index: 1; }
.hero .stats div { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .24); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 16px; }
.hero .stats b { font-size: 23px; }

/* ปุ่มลัด */
.quick a { border-radius: 20px; padding: 14px 4px 12px; gap: 8px; }
.quick svg { width: 42px; height: 42px; padding: 9px; border-radius: 14px; background: color-mix(in srgb, var(--hot) 13%, transparent); transition: transform .3s var(--ease-spring); }
.quick a:hover svg { transform: rotate(-8deg) scale(1.08); }

/* วงแหวนแคล */
.ring .big { font-size: 38px; letter-spacing: -.5px; }
.ring svg circle:nth-of-type(2) { filter: drop-shadow(0 4px 8px var(--glow)); }
.macro .fill, .progress div { position: relative; overflow: hidden; }
.macro .fill::after, .progress div::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: translateX(-100%); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.tile { border: 1px solid var(--edge); border-radius: 16px; }
.bar-v { transform-origin: bottom; }

/* รายการ */
.item, .option, .pick, .pend-card, .target, .muscle-row, .sub { border: 1px solid var(--edge); }
.note { border-radius: 16px; border: 1px solid var(--edge); border-left-width: 4px; }
.check { transition: background .25s ease, color .25s ease, transform .3s var(--ease-spring); }
.check.on { box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--good) 70%, transparent); }
.ex.done { opacity: .62; }
.ex.done .ex-info b { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--good) 70%, transparent); }

/* แถบเมนูล่าง: ลอยเป็นแคปซูล + ไฮไลต์เลื่อนตาม */
.tabbar { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding-bottom: 0; max-width: 616px; margin: 0 auto;
  border: 1px solid var(--edge); border-radius: 26px; box-shadow: var(--shadow-lg); background: var(--glass2); }
.tabbar-in { position: relative; padding: 6px; }
.tab-ind { position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 5); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .5s var(--ease-spring); pointer-events: none; }
.tab-ind::before { content: ""; position: absolute; inset: 0 4px; border-radius: 20px; background: color-mix(in srgb, var(--hot) 14%, transparent); }
.tabbar a { position: relative; z-index: 1; border-radius: 20px; padding: 7px 0 6px; transition: color .25s ease; }
.tabbar a.active { color: var(--hot); font-weight: 600; }
.tabbar a.active svg { animation: tabpop .5s var(--ease-spring); }
@keyframes tabpop { 0% { transform: scale(.7) translateY(3px); } 60% { transform: scale(1.15) translateY(-2px); } 100% { transform: none; } }
.wrap { padding-bottom: 120px; }

/* แผ่นรายละเอียด */
.sheet { background: rgba(10, 6, 14, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet-in { border-radius: 28px 28px 0 0; border: 1px solid var(--edge); border-bottom: 0; box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .45); position: relative; padding-top: 26px; }
.sheet-in::before { content: ""; position: absolute; top: 9px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 99px; background: var(--line); }
.sheet.sheet-enter { animation: fade .25s ease both; }
.sheet.sheet-enter .sheet-in { animation: sheetUp .5s var(--ease-out) both; }
@keyframes sheetUp { from { transform: translateY(70%); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.session.wk-enter { animation: sessionIn .5s var(--ease-out) both; }
@keyframes sessionIn { from { transform: translateY(40px) scale(.98); opacity: 0; } }
.slide-in { animation: rise .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.ex-fig.big, .timer, .setlist li { border: 1px solid var(--edge); }
.setlist li { transition: background .25s ease; }
.setlist li.ok { background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.timer-ring svg circle:last-child { filter: drop-shadow(0 4px 10px var(--glow)); }
.done-hero { box-shadow: 0 18px 40px -16px var(--glow); }

/* เข้าหน้าใหม่: การ์ดลอยขึ้นทีละใบ */
.wrap.enter > * { animation: rise .55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.985); } }
.pop { animation: pop .42s var(--ease-spring); }
@keyframes pop { 0% { transform: scale(.9); } 55% { transform: scale(1.07); } 100% { transform: scale(1); } }

/* คลื่นตอนกด */
.rip-host { position: fixed; z-index: 60; overflow: hidden; pointer-events: none; }
.rip { position: absolute; border-radius: 50%; background: color-mix(in srgb, var(--ink) 14%, transparent); transform: scale(0); animation: ripple .6s var(--ease-out) forwards; }
.rip.light { background: rgba(255, 255, 255, .38); }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ป้ายแจ้งเตือนเด้ง */
#toast { position: fixed; left: 0; right: 0; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 70; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 560px; background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 18px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: toastIn .45s var(--ease-spring) both; cursor: pointer; }
.toast.party { background: linear-gradient(120deg, var(--hot), var(--hot2)); color: #fff; }
.toast.err { background: var(--bad); color: #fff; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { transform: translateY(24px) scale(.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(16px); opacity: 0; } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 80; pointer-events: none; }

/* สวิตช์ */
.toggle input { transition: background .25s ease; }
.toggle input::after { transition: left .35s var(--ease-spring), background .2s ease; }
.toggle input:active::after { width: 24px; }

/* เหรียญ */
.bdg.got .bi { animation: none; }
.bdg.got:hover .bi { animation: wiggle .5s ease; }
@keyframes wiggle { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }

/* โฟกัสคีย์บอร์ด */
button:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: 3px solid color-mix(in srgb, var(--hot) 60%, transparent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===============================================================
   ธีมพิงก์นีออน (ค่าเริ่มต้น) + องค์ประกอบหน้าหลัก/โปรไฟล์ใหม่
   =============================================================== */
[data-theme="neon"] {
  --bg: #12060f; --surface: #1f0c1b; --surface2: #2c1328; --ink: #fff0f7; --muted: #c99ab6; --line: #43203c;
  --hot: #ff2e8f; --hot2: #ff7ac6; --cool: #6fd3ff; --violet: #c08bff; --sun: #ffb347;
  --good: #3ddc97; --warn: #ffb547; --bad: #ff5c7a; --prop: #5e2f57;
  --glass: rgba(18, 6, 15, .78); --glass2: rgba(31, 12, 27, .86); --on-ink: #12060f; color-scheme: dark;
  --edge: rgba(255, 90, 170, .16);
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 14px 34px -16px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 46, 143, .04);
  --glow: rgba(255, 46, 143, .6);
}
[data-theme="neon"] body::before {
  background: radial-gradient(50% 45% at 100% 0%, rgba(255, 46, 143, .32), transparent 70%),
              radial-gradient(45% 40% at 0% 25%, rgba(192, 70, 255, .18), transparent 70%),
              radial-gradient(60% 40% at 50% 100%, rgba(255, 46, 143, .12), transparent 70%);
  height: 100vh; inset: 0;
}
[data-theme="neon"] .card, [data-theme="neon"] .ex, [data-theme="neon"] .lib-card, [data-theme="neon"] .quick a, [data-theme="neon"] .prog-card {
  background: linear-gradient(160deg, rgba(56, 20, 50, .82), rgba(28, 10, 25, .88)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
[data-theme="neon"] .chip.on, [data-theme="neon"] .seg button.on { background: linear-gradient(120deg, var(--hot), var(--hot2)); color: #fff; box-shadow: 0 6px 18px -6px var(--glow); }
[data-theme="neon"] .tabbar { background: rgba(22, 8, 19, .9); }
[data-theme="neon"] .brand { background: linear-gradient(90deg, #fff, var(--hot2)); -webkit-background-clip: text; background-clip: text; }
[data-theme="neon"] button:not(.ghost):not(.icon):not(.danger):not(.chip):not(.check):not(.st):not(.cat):not(.choice):not(.bp):not(.theme-btn):not(.wd) { box-shadow: 0 10px 26px -8px var(--glow), 0 0 0 1px rgba(255, 255, 255, .08) inset; }

/* หน้าหลัก: การ์ดต้อนรับแบบมีภาพท่าออกกำลังกาย */






  

 
 





.st i svg, .cta svg{ width: 24px; height: 24px; stroke: var(--hot); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }


 

.mring { position: relative; flex: none; }
.mring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mring svg circle:nth-of-type(2) { filter: drop-shadow(0 3px 6px var(--glow)); }
.mring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: var(--ink); }
.mring b small { font-size: 12px; margin-left: 1px; }
.stat4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.st { background: var(--surface); border: 1px solid var(--edge); box-shadow: var(--shadow); border-radius: 18px; padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--ink); text-decoration: none; font-weight: 500; text-align: center; }
[data-theme="neon"] .st { background: linear-gradient(160deg, rgba(56, 20, 50, .82), rgba(28, 10, 25, .88)); }
.st i { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 4px; background: color-mix(in srgb, var(--hot) 14%, transparent); }
.st b { font-family: var(--display); font-size: 19px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.st span { font-size: 11px; color: var(--muted); line-height: 1.3; }
.st.water i svg { stroke: var(--cool); } .st.water i { background: color-mix(in srgb, var(--cool) 16%, transparent); }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; font-size: 18px; padding: 16px; border-radius: 22px;
  background-size: 200% 100%; background-image: linear-gradient(90deg, var(--hot), var(--hot2), var(--hot)); animation: sheen 5s linear infinite; }
.cta svg { stroke: none; fill: #fff; width: 22px; height: 22px; }
.cta small { flex-basis: 100%; font-size: 12px; font-weight: 500; opacity: .92; }


/* คลังท่า: หมวดหมู่แบบการ์ดภาพ */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 0 0 10px; border-radius: 18px; text-align: left; color: var(--ink);
  background: linear-gradient(160deg, color-mix(in srgb, var(--hot) 26%, var(--surface2)), var(--surface)); border: 1px solid var(--edge); box-shadow: var(--shadow); }
.cat-fig { width: 100%; display: block; }
.cat b { font-family: var(--display); font-size: 14px; padding: 0 10px; }
.cat small { font-size: 11px; color: var(--muted); padding: 0 10px; font-weight: 500; }
.cat .fig .gr, .cat .fig .fnb, .cat .fig .fnt { display: none; }
@media (max-width: 420px) { .cats { grid-template-columns: repeat(4, 1fr); gap: 6px; } .cat b { font-size: 12.5px; padding: 0 7px; } .cat small { padding: 0 7px; } }

/* หน้าฉัน: การ์ดโปรไฟล์ */

.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 28px; font-weight: 700;
  background: rgba(255, 255, 255, .2); border: 2px solid rgba(255, 255, 255, .6); box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); }




.lv { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .25); overflow: hidden; margin-top: 4px; }
.lv div { height: 100%; background: #fff; border-radius: 99px; }

  




.mring b { display: flex; align-items: baseline; justify-content: center; place-items: initial; align-content: center; flex-wrap: nowrap; }
.mring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.st { position: relative; }
.st b small { font-size: 11px; color: var(--muted); font-weight: 500; }
.st .plus { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 700; line-height: 1; color: #fff; background: var(--cool); }

/* ===============================================================
   หน้าหลักเวอร์ชัน 3: วงแหวน 3 ชั้น, สถิติต่อเนื่อง, เวิร์กเอาต์แบบเลื่อนข้าง
   =============================================================== */
.tiny { font-size: 11.5px; }
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.sec-h h2 { font-size: 19px; }
.sec-more { font-size: 13px; font-weight: 600; color: var(--hot); text-decoration: none; white-space: nowrap; }
a.card { text-decoration: none; color: inherit; }

/* วงแหวน 3 ชั้น */
.tr-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: center; }
.tri { width: 170px; height: 170px; }
.tri svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.tri .tr { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hot) 35%, transparent)); }
.tr-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tr-legend li { display: flex; flex-direction: column; padding-left: 14px; position: relative; }
.tr-legend li::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 99px; background: var(--c); }
.tr-legend span { font-size: 12.5px; color: var(--muted); }
.tr-legend b { font-family: var(--display); font-size: 22px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tr-legend b small { font-size: 12px; color: var(--muted); font-weight: 500; }
.tr-actions { gap: 8px; }
.water-btn { padding: 9px 14px; }
@media (max-width: 380px) { .tr-wrap { grid-template-columns: 1fr; justify-items: center; } .tr-legend { flex-direction: row; justify-content: space-around; width: 100%; } }

/* เวิร์กเอาต์วันนี้: การ์ดเลื่อนข้าง */
.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.wcard { flex: 0 0 138px; scroll-snap-align: start; position: relative; display: flex; flex-direction: column; gap: 2px; padding: 0 0 10px; border-radius: 20px; overflow: hidden; text-decoration: none; color: var(--ink);
  background: linear-gradient(165deg, color-mix(in srgb, var(--hot) 24%, var(--surface2)), var(--surface)); border: 1px solid var(--edge); box-shadow: var(--shadow); transition: transform .25s var(--ease-spring); }
.wcard:active { transform: scale(.96); }
.wcard .wfig { display: block; }
.wcard .fig .gr, .wcard .fig .fnb, .wcard .fig .fnt { display: none; }
.wcard b { font-family: var(--display); font-size: 13.5px; font-weight: 600; line-height: 1.25; padding: 0 10px; }
.wcard small { font-size: 11.5px; color: var(--muted); padding: 0 10px; }
.wnum { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--glass2); color: var(--ink); }
.wcard.ok { opacity: .7; } .wcard.ok .wnum { background: var(--good); color: #fff; }

/* สถิติต่อเนื่อง */
.streak { gap: 12px; }
.sk-top { display: flex; align-items: center; gap: 14px; }
.flame { font-size: 40px; line-height: 1; filter: grayscale(1) opacity(.45); }
.flame.lit { filter: none; animation: flicker 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(2deg); } }
.sk-n { font-family: var(--display); font-size: 34px; line-height: 1; }
.sk-l { font-family: var(--display); font-size: 16px; font-weight: 600; }
.sk-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.sk-d { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.sk-d i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 15px; font-weight: 700; background: var(--surface2); border: 2px solid transparent; color: #fff; }
.sk-d.on i { background: linear-gradient(140deg, #ff8a3d, var(--hot)); box-shadow: 0 6px 14px -6px var(--glow); }
.sk-d.today i { border-color: var(--hot); }
.sk-d.today span { color: var(--hot); }
.sk-d.future i { opacity: .45; }

/* อาหารวันนี้แบบย่อ */

.fm-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.fm-big { font-family: var(--display); font-size: 30px; font-variant-numeric: tabular-nums; }
.progress.over div { background: var(--bad); }
.fm-macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fm-macros div { display: flex; flex-direction: column; gap: 3px; }
.fm-macros span { font-size: 12px; color: var(--muted); }
.fm-macros b { font-family: var(--display); font-size: 16px; font-variant-numeric: tabular-nums; } .fm-macros b small { font-size: 11px; color: var(--muted); font-weight: 500; }
.fm-macros i { display: block; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--c) 18%, transparent); overflow: hidden; }
.fm-macros em { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.fm-next { font-size: 13.5px; padding: 10px 12px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--edge); }
.body-mini { gap: 10px; }


/* โหมดฝึก: ข้อความโค้ชตอนพัก */
.coach { font-size: 14px; font-weight: 500; text-align: center; color: var(--ink); background: color-mix(in srgb, var(--hot) 12%, transparent); border-radius: 14px; padding: 8px 14px; animation: rise .5s var(--ease-out) both; }

/* ===============================================================
   เวอร์ชัน 4: ระบบไอคอน, หัวข้อมีไอคอน, หน้าว่าง, รอ AI, หมวดพับได้, ภาพเคลื่อนไหวเพิ่ม
   ระยะเวลาภาพเคลื่อนไหวอิงแนวทาง Material/Atlassian: กด 100–150ms, เข้า 250–400ms, ฉลอง 600ms+
   =============================================================== */
:root { --d-fast: 140ms; --d-med: 280ms; --d-slow: 450ms; }

/* ไอคอน */
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }
.ic.sm { width: 18px; height: 18px; } .ic.xs { width: 14px; height: 14px; stroke-width: 2.4; }
.ic.gold { color: var(--sun); }
button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; }
.icon.round { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.icon.round .ic { width: 20px; height: 20px; }
.icon.round.add { background: color-mix(in srgb, var(--hot) 16%, var(--surface2)); color: var(--hot); }
.qty button .ic { width: 16px; height: 16px; }

.pr-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lbl-ic { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.delta, .tile small { display: inline-flex; align-items: center; gap: 2px; }
.pill { display: inline-flex; align-items: center; gap: 4px; }
.wnum .ic, .sk-d i .ic { width: 14px; height: 14px; stroke-width: 3; }

.sec-more { display: inline-flex; align-items: center; gap: 2px; }
.coach { display: flex; align-items: center; justify-content: center; gap: 6px; }
.aib { display: inline-flex; align-items: center; gap: 6px; }
.sync { display: inline-flex; align-items: center; gap: 5px; }
.sync[data-state="saving"] .ic, .sync[data-state="loading"] .ic { animation: spin 1s linear infinite; }
.sync[data-state="synced"] { color: var(--good); }
@keyframes spin { to { transform: rotate(360deg); } }

/* หัวข้อการ์ดมีไอคอน (ช่วยให้กวาดตาหาหมวดได้เร็ว) */
h2.hi { display: flex; align-items: center; gap: 10px; }
.hic { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; color: var(--hot);
  background: color-mix(in srgb, var(--hot) 14%, transparent); border: 1px solid color-mix(in srgb, var(--hot) 18%, transparent); }
.hic .ic { width: 19px; height: 19px; }

/* การ์ดเตือน */
.remind { display: flex; align-items: center; gap: 12px; }
.remind > span:nth-child(2) { flex: 1; }
.remind-ic { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--warn); background: color-mix(in srgb, var(--warn) 18%, transparent); }
.remind-ic .ic { width: 20px; height: 20px; }
.remind-go { width: 18px; height: 18px; opacity: .6; }

/* ข้อความแจ้งในการ์ด: มีไอคอนตามระดับ (ไม่ใช้สีอย่างเดียว) */
.note { display: flex; gap: 10px; align-items: flex-start; }
.note-ic { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.note.good .note-ic { color: var(--good); } .note.warn .note-ic { color: var(--warn); } .note.bad .note-ic { color: var(--bad); } .note.info .note-ic { color: var(--cool); }

/* หน้าว่าง: บอกว่าว่างเพราะอะไร + ทำอะไรต่อ */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 10px 6px; }
.empty-ic { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; color: var(--hot);
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--hot) 30%, transparent), color-mix(in srgb, var(--hot) 8%, transparent));
  box-shadow: 0 10px 26px -10px var(--glow); animation: bob 3.2s ease-in-out infinite; }
.empty-ic .ic { width: 30px; height: 30px; }
.empty b { font-family: var(--display); font-size: 16px; }
.empty p { max-width: 320px; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-3deg); } }

/* รอ AI: แสดงขั้นตอนที่กำลังทำ + โครงร่างกระพริบ */
.ai-wait { display: flex; flex-direction: column; gap: 9px; padding: 14px; border-radius: 16px; border: 1px solid var(--edge);
  background: linear-gradient(135deg, color-mix(in srgb, var(--hot) 10%, var(--surface2)), color-mix(in srgb, var(--violet) 10%, var(--surface2))); }
.aw-top { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.aw-spin { color: var(--hot); display: grid; place-items: center; animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.18) rotate(18deg); opacity: .7; } }
.aw-steps { position: relative; flex: 1; height: 22px; overflow: hidden; font-size: 14px; font-weight: 500; }
.aw-steps span { position: absolute; inset: 0; opacity: 0; animation: stepcycle calc(var(--n) * 1.8s) infinite; animation-delay: calc(var(--k) * 1.8s); }
@keyframes stepcycle { 0% { opacity: 0; transform: translateY(8px); } 6%, 30% { opacity: 1; transform: none; } 36%, 100% { opacity: 0; transform: translateY(-8px); } }
.sk { display: block; height: 11px; border-radius: 99px; background: linear-gradient(90deg, var(--surface2) 0%, color-mix(in srgb, var(--ink) 14%, var(--surface2)) 50%, var(--surface2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk.w80 { width: 80%; } .sk.w60 { width: 60%; } .sk.w70 { width: 70%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* หน้าอาหาร */
.page-h { align-items: center; }
.date-nav { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--edge); border-radius: 99px; padding: 4px; box-shadow: var(--shadow); }
.date-nav b { min-width: 64px; text-align: center; font-size: 14px; }
.date-nav .icon.round { width: 32px; height: 32px; }
.fdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.fd { flex-direction: column; gap: 0; padding: 7px 0 6px; border-radius: 16px; background: var(--surface); color: var(--muted); border: 1px solid var(--edge); box-shadow: none; font-weight: 600; }
.fd span { font-size: 11px; } .fd b { font-family: var(--display); font-size: 17px; color: var(--ink); line-height: 1.2; }
.fd i { width: 5px; height: 5px; border-radius: 50%; margin-top: 2px; background: transparent; }
.fd.has i { background: var(--hot); }
.fd.on { background: linear-gradient(160deg, var(--hot), var(--hot2)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -8px var(--glow); }
.fd.on b { color: #fff; } .fd.on.has i { background: #fff; }
.meal-chips .chip .ic { width: 16px; height: 16px; }
.meal-head .mh-name { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.meal-head .mh-name .ic { color: var(--hot); }

/* แท็บหน้าฝึก: ไอคอนเหนือคำ */
.seg-ic button { flex-direction: column; gap: 2px; padding: 7px 0 6px; font-size: 11.5px; }
.seg-ic button .ic { width: 19px; height: 19px; }
.seg-ic button.on .ic { animation: tabpop .45s var(--ease-spring); }
.start-btn .sb-row { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.start-btn .sb-row .ic { width: 20px; height: 20px; }

/* เครื่องหมายถูก: วาดเส้นเฉพาะปุ่มที่เพิ่งกด */
.check .ic { width: 20px; height: 20px; stroke-width: 3; }
.check.on.pop .ic path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .45s var(--ease-out) .05s forwards; }
.check.on.pop { animation: popbig .5s var(--ease-spring); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes popbig { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.setlist li .ic { color: var(--good); }

/* กราฟ */
.chart .end-lbl { fill: var(--ink); font-family: var(--display); font-size: 15px; font-weight: 700; }
.chart .end { filter: drop-shadow(0 0 6px currentColor); }
.wrap.enter .chart .ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawline 1.3s var(--ease-out) .25s forwards; }
.wrap.enter .chart .area { opacity: 0; animation: fade-in .8s ease .9s forwards; }
.wrap.enter .chart .pt { opacity: 0; animation: fade-in .3s ease forwards; animation-delay: calc(.4s + var(--i) * 45ms); }
@keyframes drawline { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

/* หมวดพับเก็บได้ (หน้าฉัน) */
.acc-group { display: flex; flex-direction: column; gap: 8px; }

.acc { background: var(--surface); border: 1px solid var(--edge); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
[data-theme="neon"] .acc { background: linear-gradient(160deg, rgba(56, 20, 50, .82), rgba(28, 10, 25, .88)); }
.acc-h { width: 100%; justify-content: flex-start; gap: 12px; padding: 14px 16px; border-radius: 0; background: transparent; color: var(--ink); box-shadow: none; text-align: left; }
.acc-h:not(:disabled):active { transform: none; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.acc-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.acc-t b { font-family: var(--display); font-weight: 600; font-size: 15px; }
.acc-t small { font-size: 12px; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-chev { width: 20px; height: 20px; color: var(--muted); transition: transform var(--d-med) var(--ease-out); }
.acc.open .acc-chev { transform: rotate(180deg); color: var(--hot); }
.acc-b { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.acc-h.pop + .acc-b { animation: accIn .38s var(--ease-out); }
@keyframes accIn { from { opacity: 0; transform: translateY(-8px); } }

/* เปลวไฟวันต่อเนื่อง */
.flame-art { width: 46px; height: 54px; flex: none; filter: grayscale(1) opacity(.4); }
.flame-art.lit { filter: drop-shadow(0 6px 12px rgba(255, 70, 120, .45)); }
.flame-art.lit .fo { transform-origin: 50% 95%; animation: flick 1.8s ease-in-out infinite; }
.flame-art.lit .fi { transform-origin: 50% 95%; animation: flick 1.3s ease-in-out infinite reverse; }
@keyframes flick { 0%, 100% { transform: scale(1, 1) skewX(0); } 30% { transform: scale(.96, 1.05) skewX(-2deg); } 65% { transform: scale(1.03, .97) skewX(2deg); } }

/* ตัวเลขเปลี่ยนค่า: เด้งเล็กน้อย */
.bump { animation: bump .5s var(--ease-spring); display: inline-block; }
@keyframes bump { 40% { transform: scale(1.14); color: var(--hot); } }

/* วงแหวนปิดได้: เรืองแสง */
.tri.ring-win { animation: ringwin 1.2s ease; }
@keyframes ringwin { 30% { transform: scale(1.06); filter: drop-shadow(0 0 18px var(--glow)); } }

/* เปลี่ยนหน้าตามทิศของแท็บ */
.wrap.enter.fwd > * { animation-name: riseFwd; }
.wrap.enter.back > * { animation-name: riseBack; }
@keyframes riseFwd { from { opacity: 0; transform: translateX(28px); } }
@keyframes riseBack { from { opacity: 0; transform: translateX(-28px); } }

/* ป้ายแจ้งเตือน: ไอคอน + แถบเวลาที่เหลือ */
.toast { display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden; padding: 12px 16px 14px; }
.t-ic { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--on-ink) 14%, transparent); }
.toast.party .t-ic, .toast.err .t-ic { background: rgba(255, 255, 255, .22); }
.t-ic .ic { width: 18px; height: 18px; }
.t-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: currentColor; opacity: .35; transform-origin: left; animation: tbar linear forwards; }
@keyframes tbar { to { transform: scaleX(0); } }
.toast.party .t-ic { animation: popbig .6s var(--ease-spring) .1s both; }
/* แก้: ข้อความแจ้งในการ์ดเป็นบล็อกปกติ เฉพาะรายการที่มีไอคอนเรียงแถว */
.note { display: block; }
.notes .note, .note.nf { display: flex; }
.note.nf > div { flex: 1; min-width: 0; }
.tile small { display: block; }
.tile small .ic { vertical-align: -2px; margin-right: 2px; }
.bdg .pill { align-self: flex-start; margin-top: 2px; }
/* โหมดฝึก: ช่องตัวเลขพร้อมปุ่ม − / + ขนาดใหญ่ (กดง่ายระหว่างเล่น) */
.set-now { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stepper { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-l { font-size: 13px; color: var(--muted); }
.st-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--edge); border-radius: 18px; padding: 5px; }
.st-row input { width: 100%; background: transparent; border: 0; box-shadow: none; padding: 8px 0; font-size: 24px; text-align: center; font-family: var(--display); }
.st-row input:focus { box-shadow: none; }
.st-b { width: 44px; height: 44px; padding: 0; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: none; border: 1px solid var(--edge); }
.st-b .ic { width: 20px; height: 20px; stroke-width: 2.6; }
.st-b:not(:disabled):active { transform: scale(.9); background: color-mix(in srgb, var(--hot) 22%, var(--surface)); }
@media (prefers-reduced-motion: reduce) {
  .aw-steps span { animation: none !important; }
  .aw-steps span:first-child { opacity: 1; }
  .sk { animation: none !important; }
}
/* นับก้าวด้วยมือถือ */
.pedo-btn { background: linear-gradient(120deg, var(--hot), var(--hot2)); }
#pedo { position: fixed; inset: 0; z-index: 40; background: rgba(8, 3, 10, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; }
#pedo[hidden] { display: none; }
.pd-in { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--edge); border-radius: 28px 28px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; animation: sheetUp .45s var(--ease-out) both; }
.pd-head { display: flex; align-items: center; gap: 8px; color: var(--hot); width: 100%; justify-content: center; }
.pd-head b { color: var(--ink); font-family: var(--display); }
.pd-live { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--bad); margin-left: 6px; }
.pd-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.pd-n { font-family: var(--display); font-size: 72px; line-height: 1.05; margin-top: 8px; font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--hot), var(--hot2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pd-u { font-size: 14px; color: var(--muted); margin-top: -4px; }
.pd-t { font-size: 14px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pd-s { margin: 8px 0 4px; padding: 8px 12px; border-radius: 12px; background: var(--surface2); max-width: 420px; }
.pd-s.bad { background: color-mix(in srgb, var(--warn) 18%, var(--surface2)); }
.pd-btns { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 420px; margin-top: 6px; }

/* ===== ลดความรก (v5) ===== */
.photo-btn { flex-direction: row; padding: 12px; font-size: 14px; }
.photo-btn .ic { color: var(--hot); }
.photo-btn.slim { width: 100%; }


.tipbox summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tipbox summary::-webkit-details-marker { display: none; }
.tipbox p { margin-top: 6px; }

/* การ์ดเดิน */
.walk-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.walk-acts button { padding: 11px 10px; border-radius: 16px; }
.pedo-btn { color: #fff; }
.walk-more { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--edge); animation: accIn .3s var(--ease-out); }
.walk .bars { height: 56px; }

/* วันต่อเนื่องแบบกะทัดรัด */
.card.streak { gap: 10px; padding: 14px 16px; }
.streak .flame-art { width: 36px; height: 42px; }
.sk-top { gap: 12px; }
.sk-txt p { margin-top: 1px; }
.sk-n { font-size: 28px; }
.sk-d i { width: 30px; height: 30px; }

/* ตัวเลขแถวเดียว */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-row > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--edge); min-width: 0; }
.stat-row span { font-size: 12px; color: var(--muted); }
.stat-row b { font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-row b small { font-size: 11px; color: var(--muted); font-weight: 500; }
.tr-actions { justify-content: flex-start; }
/* สัปดาห์: แยกวันออกกำลังกาย / วันบันทึกอย่างเดียว */
.sk-d.log i { background: var(--surface2); border: 2px dashed color-mix(in srgb, var(--hot) 45%, transparent); }
.sk-d.log i em { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--hot) 60%, transparent); }
.sk-d.on i { color: #fff; }
.sk-d.on i .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.sk-w { color: var(--ink); }
.sk-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); }
.sk-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sk-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sk-legend i.on, .sk-legend i.hit { background: linear-gradient(140deg, #ff8a3d, var(--hot)); }
.sk-legend i.log { border: 2px dashed color-mix(in srgb, var(--hot) 55%, transparent); }
.sk-legend i.part { background: linear-gradient(180deg, var(--cool), color-mix(in srgb, var(--cool) 55%, var(--violet))); }
.sk-legend i.goal { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed var(--muted); }

/* กราฟแท่งก้าว: มีสีทุกวัน */
.walk .bars.steps-bars { height: 92px; position: relative; padding-top: 14px; }
.steps-bars::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(18px + (100% - 32px) * var(--goal) / 100); border-top: 2px dashed color-mix(in srgb, var(--muted) 70%, transparent); pointer-events: none; }
.steps-bars .bar-col { position: relative; }
.steps-bars .bar-col small { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 12px; }
.steps-bars .bar-v { width: 62%; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--muted) 22%, transparent); }
.steps-bars .bar-v.part { background: linear-gradient(180deg, var(--cool), color-mix(in srgb, var(--cool) 55%, var(--violet))); }
.steps-bars .bar-v.hit { background: linear-gradient(180deg, #ff8a3d, var(--hot)); box-shadow: 0 4px 12px -4px var(--glow); }
.steps-bars .bar-col.today span { color: var(--hot); font-weight: 700; }
.steps-bars .bar-col.today small { color: var(--ink); font-weight: 600; }
.walk .bars.steps-bars { height: auto; padding-top: 0; }
.steps-bars::after { display: none; }
.steps-bars .bar-col { height: auto; gap: 3px; }
.bar-area { position: relative; width: 100%; height: 60px; display: flex; align-items: flex-end; justify-content: center; }
.bar-area::after { content: ""; position: absolute; left: -3px; right: -3px; bottom: var(--goal); border-top: 2px dashed color-mix(in srgb, var(--muted) 65%, transparent); pointer-events: none; }
.steps-bars .bar-v { height: 4px; }
/* คลังท่า: หมวดหมู่เป็นทางเข้าเดียว */
.search-box { position: relative; }
.search-box .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { width: 100%; padding-left: 42px; }
.cat b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cat-head { display: flex; align-items: center; gap: 12px; }
.cat-head > div { display: flex; flex-direction: column; }
.cat-head b { font-family: var(--display); font-size: 20px; line-height: 1.2; }
.eq-chips .chip { font-size: 12.5px; padding: 5px 12px; }

/* ===== ส่วนท้ายหน้าตาราง ===== */
.plan-foot { gap: 14px; }
.pf-prog { display: flex; align-items: center; gap: 12px; }
.pf-prog > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pf-prog small { font-size: 12px; }
.pf-prog b { font-family: var(--display); font-size: 16px; line-height: 1.3; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool { flex-direction: column; gap: 6px; padding: 14px 6px 12px; border-radius: 18px; background: var(--surface2); color: var(--ink); border: 1px solid var(--edge); box-shadow: none; font-size: 13px; font-weight: 600; line-height: 1.25; text-align: center; min-height: 82px; }
.tool .ic { color: var(--hot); width: 22px; height: 22px; }
.warn-tool .ic { color: var(--warn); }
.warn-tool.confirm { background: color-mix(in srgb, var(--bad) 16%, var(--surface2)); border-color: var(--bad); color: var(--bad); }
.warn-tool.confirm .ic { color: var(--bad); }

/* ===== หน้าแก้ไขตาราง ===== */
.edit-bar { position: sticky; top: 52px; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 20px;
  background: var(--glass2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--edge); box-shadow: var(--shadow); }
.edit-bar > div { display: flex; flex-direction: column; gap: 2px; }
.edit-bar h2 { font-size: 17px; }
.edit-day { gap: 12px; }
.ed-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.ed-name { font-family: var(--display); font-size: 17px; font-weight: 600; }
.ed-wd { min-width: 112px; }
.ed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ed-item { display: grid; grid-template-columns: 24px 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--edge); }
.ed-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface); }
.ed-fig { border-radius: 10px; background: var(--surface); overflow: hidden; }
.ed-fig .fig .gr, .ed-fig .fig .fnb, .ed-fig .fig .fnt { display: none; }
.ed-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ed-main b { font-family: var(--display); font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.ed-sets { flex-direction: row; align-items: center; gap: 6px; color: var(--muted); }
.ed-sets input { padding: 6px 10px; font-size: 13.5px; width: 100%; max-width: 160px; background: var(--surface); }
.ed-acts { display: grid; grid-template-columns: 1fr; gap: 4px; }
.ed-acts .icon.round { width: 32px; height: 32px; background: var(--surface); }
.ed-acts .icon.round.del { color: var(--bad); }
.ed-acts .icon.round:disabled { opacity: .3; }
.ed-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ed-foot .ghost { flex: 1; }
.text-danger { background: transparent; color: var(--bad); box-shadow: none; padding: 10px 12px; font-size: 13.5px; }
.text-danger.confirm { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.add-day { width: 100%; padding: 16px; border-radius: 20px; background: transparent; color: var(--hot); border: 2px dashed color-mix(in srgb, var(--hot) 45%, transparent); box-shadow: none; font-size: 15px; }
.ed-item { grid-template-columns: 24px 58px minmax(0, 1fr); }
.ed-row { display: flex; align-items: center; gap: 6px; }
.ed-sets { flex: 1; min-width: 0; }
.ed-sets input { max-width: none; }
.ed-acts { display: flex; gap: 4px; }
.ed-acts .icon.round { width: 30px; height: 30px; }
.ed-acts .icon.round .ic { width: 16px; height: 16px; }

/* ===== หน้าร่างกาย (จัดใหม่) ===== */
.mini-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; grid-template-columns: none; padding: 3px; border-radius: 14px; }
.mini-seg button { padding: 7px 12px; font-size: 13px; border-radius: 11px; gap: 5px; }
.mini-seg button .ic { width: 16px; height: 16px; }
.log-card > .mini-seg { display: grid; width: 100%; }
.quick-log { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick-log label { gap: 6px; font-size: 12.5px; }
.unit-in { position: relative; display: block; }
.unit-in input { width: 100%; padding: 12px 34px 12px 12px; font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; }
.unit-in em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--muted); pointer-events: none; }
.log-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.log-foot > button:last-child { flex: 1; max-width: 260px; padding: 12px 16px; }
.date-mini { flex-direction: row; align-items: center; gap: 6px; padding: 0 4px 0 12px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--edge); color: var(--muted); }
.date-mini input { background: transparent; border: 0; padding: 10px 8px 10px 0; font-size: 13.5px; box-shadow: none; }
.link-btn { align-self: flex-start; background: transparent; color: var(--hot); box-shadow: none; padding: 6px 2px; font-size: 13.5px; }
.scan-cap { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: -4px; }
.scan-more > summary { margin: 2px 0; }
.scan-more[open] > summary .ic { transform: rotate(180deg); }
.scan-more .scan-grid { margin-top: 8px; }
.week-card .spread h2.hi { font-size: 17px; }
@media (max-width: 380px) { .quick-log { grid-template-columns: 1fr 1fr; } }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hist li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; }
.h-date { font-size: 13px; color: var(--muted); font-weight: 500; }
.h-vals { display: flex; flex-wrap: wrap; gap: 6px; }
.h-vals span { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: var(--surface2); font-variant-numeric: tabular-nums; }
.h-vals .ic { color: var(--hot); }
.hist .icon.round { width: 32px; height: 32px; color: var(--muted); }
p.tiny .ic { vertical-align: -2px; }

/* ===== ฟีเจอร์ชุดใหม่ (v6) ===== */
/* แท็บหน้าร่างกาย */
.body-tabs { margin-bottom: 2px; }
.metric-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.metric-chips::-webkit-scrollbar { display: none; }

/* ระดับความยาก */
.dl { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; padding: 3px 8px 3px 6px; border-radius: 99px; white-space: nowrap;
  background: color-mix(in srgb, var(--dlc) 16%, transparent); color: var(--dlc); --dlc: var(--good); }
.dl i { width: 4px; height: 10px; border-radius: 2px; background: currentColor; opacity: .25; }
.dl i:last-of-type { margin-right: 3px; }
.dl1 { --dlc: var(--good); } .dl2 { --dlc: var(--warn); } .dl3 { --dlc: var(--bad); }
.dl1 i:nth-child(1), .dl2 i:nth-child(-n+2), .dl3 i { opacity: 1; }
.lv-chips { align-items: center; }
.lv-chips .chip .dl { padding: 0; background: none; margin-right: 2px; }
.lv-chips .chip .dl i:last-of-type { margin-right: 0; }
.ladder { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 16px; background: var(--surface2); }
.lad-row { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.lad-row::-webkit-scrollbar { display: none; }
.lad { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 132px; padding: 8px 10px; border-radius: 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--edge); box-shadow: none; text-align: left; }
.lad b { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.lad.me { border-color: var(--hot); background: color-mix(in srgb, var(--hot) 12%, var(--surface)); opacity: 1; }
.lad-arr { flex: none; opacity: .5; }
.swap-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.swap-row .chip { font-size: 12.5px; }

/* ราคาอาหาร / งบ */
.price-in { flex-direction: row; align-items: center; gap: 2px; flex: none; font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--surface2); border-radius: 10px; padding: 0 2px 0 8px; height: 34px; }
.price-in input { width: 52px; height: 30px; padding: 0 4px; border: 0; background: transparent; font-size: 14px; text-align: right; box-shadow: none; }
.price-in input:focus { outline: 2px solid color-mix(in srgb, var(--hot) 50%, transparent); border-radius: 8px; }
.list .item { align-items: center; }
.list .item .main { min-width: 0; }
.budget .progress > div { background: linear-gradient(90deg, var(--good), color-mix(in srgb, var(--good) 40%, var(--sun))); }
.budget .progress.over > div { background: var(--bad); }
.inline-set { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); }
.inline-set .unit-in { width: 140px; }
.fm-money { color: var(--muted); }
.fm-money b { color: var(--ink); }

/* ปรับแคล */
.need { display: flex; flex-direction: column; gap: 4px; }
.need .progress { height: 6px; }

/* การนอน */
.sleep-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.sb-col { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.sb-col small { height: 14px; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ink); }
.sb-area { position: relative; width: 100%; height: 84px; border-radius: 8px; background: var(--surface2); display: flex; align-items: flex-end; overflow: hidden; }
.sb-area::after { content: ""; position: absolute; left: 0; right: 0; bottom: 70%; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 30%, transparent); }
.sb-v { width: 100%; border-radius: 8px 8px 0 0; background: var(--surface2); transition: height var(--d-med) var(--ease-out); }
.sb-v.ok { background: linear-gradient(180deg, var(--violet), color-mix(in srgb, var(--violet) 55%, var(--cool))); }
.sb-v.mid { background: var(--warn); }
.sb-v.low { background: var(--bad); }
.sb-col.today span { color: var(--hot); font-weight: 700; }
.sleep-btn { background: linear-gradient(120deg, var(--hot), var(--hot2)); }
.sleep-btn small { display: block; font-size: 11.5px; opacity: .85; font-weight: 500; }
button.remind { width: 100%; text-align: left; font: inherit; font-size: 14px; font-weight: 500; box-shadow: none; }
.remind-btn { flex: none; font-size: 12.5px; padding: 6px 12px; border-radius: 99px; background: var(--ink); color: var(--bg); }
.remind.sleep-rem { background: color-mix(in srgb, var(--violet) 16%, var(--surface)); border-color: color-mix(in srgb, var(--violet) 40%, transparent); }
.remind.sleep-rem .remind-ic { color: var(--violet); background: color-mix(in srgb, var(--violet) 20%, transparent); }

/* รูปเทียบก่อน-หลัง */
.cmp { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--surface2); touch-action: pan-y; user-select: none; }
.cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--x); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, .4); pointer-events: none; }
.cmp-line::after { content: ""; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .35); background-image: linear-gradient(90deg, transparent 38%, #999 38% 44%, transparent 44% 56%, #999 56% 62%, transparent 62%); }
.cmp input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.cmp-l, .cmp-r { position: absolute; top: 10px; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; pointer-events: none; }
.cmp-l { left: 10px; } .cmp-r { right: 10px; }
.ph-one { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 420px; }
.ph-one img { width: 100%; height: 100%; object-fit: cover; }
.ph-one span { position: absolute; left: 10px; top: 10px; font-size: 12px; padding: 4px 10px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; }
.ph-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ph-strip::-webkit-scrollbar { display: none; }
.ph-th { position: relative; flex: none; width: 76px; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); text-align: center; }
.ph-th img { width: 76px; height: 100px; object-fit: cover; border-radius: 12px; }
.ph-th button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; min-height: 0; padding: 0; background: rgba(0, 0, 0, .55); color: #fff; }

/* ภาพสรุปเดือน */
#share { position: fixed; inset: 0; z-index: 40; background: rgba(8, 3, 10, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; }
#share[hidden] { display: none; }
.share-in { align-items: stretch; gap: 10px; max-height: 94vh; overflow-y: auto; }
.share-in img { width: 100%; max-width: 380px; align-self: center; border-radius: 18px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); -webkit-touch-callout: default; }
.share-in .pd-btns { align-self: center; }

/* รอบเดือน */
.note.cyc { background: color-mix(in srgb, var(--violet) 14%, var(--surface)); }
.note.cyc .note-ic { color: var(--violet); }
.price-in.sm { align-self: flex-start; height: 28px; margin-top: 4px; font-size: 12px; border-radius: 8px; padding-left: 8px; }
.price-in.sm input { height: 26px; width: 56px; font-size: 13px; text-align: left; }
.price-in.sm input::placeholder { color: var(--muted); opacity: .7; }

/* ===== ตัวคนแบบมีรูปร่าง (v7) ===== */
.fig { --skin: #f6cdb4; --top: var(--hot); --btm: #3a2a5c; --shoe: #f4f1f8; --hair: #6a4334; }
.fig .sk { stroke: var(--skin); stroke-linecap: round; }
.fig .skf { fill: var(--skin); }
.fig .tp { stroke: var(--top); stroke-linecap: round; }
.fig .bt { stroke: var(--btm); stroke-linecap: round; }
.fig .sh { fill: var(--shoe); stroke: var(--shoe); stroke-linecap: round; }
.fig .hr { fill: var(--hair); }
.fig .shd { fill: #000; opacity: .18; }
.fig .bk { opacity: .55; }
.fig .bk .sk { stroke: color-mix(in srgb, var(--skin) 70%, #3a2030); }
.fig .bk .skf { fill: color-mix(in srgb, var(--skin) 70%, #3a2030); }
.fig .bk .tp { stroke: color-mix(in srgb, var(--top) 70%, #000); }
[data-theme="light"] .fig, [data-theme="sakura"] .fig { --btm: #4a3a6e; --shoe: #2f2440; --hair: #3a2433; }
[data-theme="light"] .fig .shd, [data-theme="sakura"] .fig .shd { opacity: .1; }



/* ภาพประกอบอาหาร */
.fart { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--hot2) 22%, var(--surface)), var(--surface)); border: 1px solid var(--edge); }
.fart svg { width: 38px; height: 38px; display: block; }
.fart.xs { width: 22px; height: 22px; border: 0; border-radius: 7px; background: none; margin-left: -4px; }
.fart.xs svg { width: 22px; height: 22px; }
.item .main, .option .opt-main { flex: 1; }
.option { justify-content: flex-start; }
.option > .row { margin-left: auto; }
.food-chip { padding-left: 8px; }

/* แสงสีตามกลุ่มกล้ามเนื้อหลังภาพท่า */
.fig { background: radial-gradient(ellipse 62% 55% at 50% 96%, color-mix(in srgb, var(--cc, var(--hot)) 22%, transparent), transparent 72%); }

.cat { background: linear-gradient(160deg, color-mix(in srgb, var(--cc, var(--hot)) 26%, var(--surface)) 0%, var(--surface) 70%); }
.cat small { color: color-mix(in srgb, var(--cc, var(--hot)) 60%, var(--ink)); }

/* ปกโปรแกรม */
.prog { padding: 0 0 14px; overflow: hidden; flex: none; }
.prog > *:not(.prog-cover) { margin: 0 14px; }
.prog-top { grid-template-columns: 1fr; }
.prog-cover { position: relative; height: 118px; display: flex; align-items: flex-end; padding: 0 8px; overflow: hidden;
  background: radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--cc) 55%, transparent), transparent 60%), linear-gradient(135deg, color-mix(in srgb, var(--cc) 75%, #1a0b18), color-mix(in srgb, var(--cc) 30%, #12081a)); }
.prog-cover::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30px; background: linear-gradient(transparent, rgba(0, 0, 0, .18)); pointer-events: none; }
.pc-fig { width: 150px; flex: none; margin-bottom: -6px; }
.pc-fig.b { width: 120px; margin-left: -26px; opacity: .8; }
.pc-fig .fig { background: none; --top: #fff; --btm: #2a1a3e; }
.pc-fig .fig .gr, .pc-fig .fig .fnb, .pc-fig .fig .fnt, .pc-fig .fig .shd { display: none; }
.pc-fig .fig .pr { fill: rgba(255, 255, 255, .3); } .pc-fig .fig .prl { stroke: rgba(255, 255, 255, .3); }
.pc-map { position: absolute; right: 10px; top: 10px; width: 70px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.pc-map .bm-sil { fill: rgba(255, 255, 255, .35) !important; }
.pc-on { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: #fff; color: #1a0b18; }
.prog h3 { margin-top: 2px; }

/* ภาพท้องฟ้ากลางคืนในการ์ดการนอน */
.card.sleep { position: relative; overflow: hidden; background: linear-gradient(160deg, color-mix(in srgb, var(--violet) 22%, var(--surface)), var(--surface) 55%); }
.card.sleep > *:not(.night-art) { position: relative; z-index: 1; }
.night-art { position: absolute; right: 64px; top: 44px; width: 150px; pointer-events: none; z-index: 0; opacity: .9; }
.night-art .tw { animation: twinkle 3.2s ease-in-out infinite; }
.night-art .tw.d2 { animation-delay: 1.1s; } .night-art .tw.d3 { animation-delay: 2.2s; }
@keyframes twinkle { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .night-art .tw { animation: none; } }

/* ตัวกรองในคลังท่า: บอกจำนวนท่า ปิดตัวเลือกที่ไม่มีท่า */
.chip .cnt { font-size: 11px; font-weight: 600; margin-left: 5px; padding: 1px 6px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); color: inherit; opacity: .8; }
.chip.on .cnt { background: rgba(255, 255, 255, .22); opacity: 1; }
.chip.zero, .chip:disabled { opacity: .38; cursor: default; box-shadow: none; }
/* รองเท้าในธีมสว่าง: สีขาวมีขอบ ไม่เป็นจุดดำ */
[data-theme="light"] .fig, [data-theme="sakura"] .fig { --shoe: #ffffff; }
[data-theme="light"] .fig .sh, [data-theme="sakura"] .fig .sh { stroke: #c9b3c2; stroke-width: 1.4; }
[data-theme="light"] .fig line.sh, [data-theme="sakura"] .fig line.sh { stroke: #fff; }
.lib-card .row { flex-wrap: wrap; min-width: 0; }
.lib-card .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== ภาพเคลื่อนไหวชุดเพิ่ม (v8) ===== */
.seg.has-pill { position: relative; isolation: isolate; }
.seg.has-pill > button { position: relative; z-index: 1; transition: color .3s ease; }
.seg.has-pill > button.on { background: transparent !important; box-shadow: none !important; }
.seg-pill { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; }
.rv { opacity: 0; transform: translateY(22px) scale(.985); }
.rv.rv-in { opacity: 1; transform: none; transition: opacity .55s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1); }
.topbar { transition: box-shadow .3s ease, border-color .3s ease; }
.topbar.scrolled { box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .35); border-bottom-color: var(--edge); }
.tabbar a svg { transform-origin: 50% 70%; }
/* การ์ดเด่นบนหน้าแรก: แสงไล่สีเคลื่อนช้าๆ */

@keyframes heroFlow { 0%, 100% { background-position: 0% 40%; } 50% { background-position: 100% 60%; } }
/* ภาพประกอบในสถานะว่างลอยเบาๆ */
.empty .empty-ic, .empty > svg, .empty-ic { animation: floaty 3.6s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-5px); } }
/* การ์ดท่า: ภาพขยายเล็กน้อยเมื่อชี้ */
@media (hover: hover) { .lib-card .ex-fig svg, .cat .cat-fig svg { transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
  .lib-card:hover .ex-fig svg, .cat:hover .cat-fig svg { transform: scale(1.06); } }
.chip { transition: background .25s ease, color .25s ease, transform .25s cubic-bezier(.34,1.56,.64,1), opacity .25s ease; }
.fart svg { transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.item:active .fart svg, .option:active .fart svg { transform: scale(1.12) rotate(-4deg); }
@media (prefers-reduced-motion: reduce) {
  .empty-ic, .empty > svg{ animation: none !important; }
  .rv { opacity: 1; transform: none; }
}
/* จอกะพริบเมื่อหมดเวลาพัก */
.rest-flash { position: fixed; inset: 0; z-index: 60; pointer-events: none; box-shadow: inset 0 0 0 6px var(--hot), inset 0 0 80px 10px color-mix(in srgb, var(--hot) 55%, transparent);
  animation: restFlash 1.2s ease-out forwards; }
@keyframes restFlash { 0%, 40% { opacity: 1; } 20%, 60% { opacity: .35; } 100% { opacity: 0; } }
.timer .snd { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .rest-flash { animation: none; opacity: .6; transition: opacity 1s; } }

/* ===== ตัวคนแบบเรียว (v9) ===== */
.fig .f-sk { fill: var(--skin); }
.fig .f-tp { fill: var(--top); }
.fig .f-bt { fill: var(--btm); }
.fig .f-sh { fill: var(--shoe); }
.fig .band { fill: rgba(255, 255, 255, .55); }
.fig .sole { stroke: color-mix(in srgb, var(--hot) 70%, #fff); stroke-width: 1.6; stroke-linecap: round; fill: none; }
.fig .tie { fill: var(--hot); }
.fig .blush { fill: #ff8fa8; opacity: .45; }
.fig .bk .f-sk { fill: color-mix(in srgb, var(--skin) 72%, #3a2030); }
.fig .bk .f-tp { fill: color-mix(in srgb, var(--top) 70%, #000); }
.fig .bk .f-bt { fill: color-mix(in srgb, var(--btm) 80%, #000); }
[data-theme="light"] .fig .f-sh, [data-theme="sakura"] .fig .f-sh { stroke: #c9b3c2; stroke-width: 1.1; }


.pc-fig .fig .tie { fill: #fff; }

/* ===== ฟีเจอร์ชุดที่ 2 (v10) ===== */
.tool-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 520px) { .tool-grid { grid-template-columns: repeat(4, 1fr); } }
/* ความก้าวหน้าในโหมดฝึก */
.pbox { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--edge); }
.pb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pb-st { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.pb-st.up { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pb-st.mid { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pb-st.down { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.pb-row { display: flex; align-items: center; gap: 10px; }
.pb-sets { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.pb-sets span { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 3px 8px; border-radius: 8px; background: var(--surface); }
.pb-spark { width: 90px; height: 26px; flex: none; overflow: visible; }
.pb-spark polyline { fill: none; stroke: var(--hot); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pb-stuck { display: block; }
/* แผนอาหาร */
.meal-cta { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border-radius: 20px; background: var(--surface); color: var(--ink); border: 1px solid var(--edge); box-shadow: var(--shadow); font: inherit; }
.meal-cta > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.meal-cta small { font-size: 12.5px; font-weight: 400; }
.meal-sheet { gap: 12px; }
.meal-days { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.md-sum { display: flex; gap: 8px; flex-wrap: wrap; }
.md-sum span { font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--surface2); }
.md-meal { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 16px; background: var(--surface2); }
.md-item { display: flex; align-items: center; gap: 10px; }
.md-item .main { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.md-item .fart { width: 38px; height: 38px; } .md-item .fart svg { width: 31px; height: 31px; }
.shop-g { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; background: var(--surface2); }
.shop-i { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 6px; border-radius: 12px; background: transparent; color: var(--ink); box-shadow: none; text-align: left; font: inherit; font-size: 14px; }
.shop-i .main { flex: 1; }
.shop-i .cb { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--edge); display: grid; place-items: center; color: #fff; }
.shop-i.done .cb { background: var(--good); border-color: var(--good); }
.shop-i.done .main { text-decoration: line-through; opacity: .5; }
/* สรุปสัปดาห์ */
.wr-list { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.wr-list.good { color: var(--good); }
.wr-fix { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--surface2); }
.wr-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--hot); color: #fff; }
/* ภารกิจ */
.q-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.q { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.q small { font-size: 11px; line-height: 1.25; color: var(--muted); min-height: 28px; }
.q b { font-size: 13px; font-variant-numeric: tabular-nums; }
.q-ring { position: relative; width: 50px; height: 50px; display: grid; place-items: center; color: var(--hot); }
.q-ring svg.qr { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.qr-bg { fill: none; stroke: var(--surface2); stroke-width: 4; }
.qr-fg { fill: none; stroke: var(--hot); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.22,1,.36,1); }
.q.ok .qr-fg { stroke: var(--good); } .q.ok .q-ring { color: var(--good); }
/* ท่าเสี่ยง */
.tag.risk { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); display: inline-flex; align-items: center; gap: 3px; }
/* เป้าสัดส่วน */
.goal-r { display: flex; flex-direction: column; gap: 5px; padding-top: 4px; }
.good-t { color: var(--good); font-weight: 600; }
/* โหมดวงจร */
#circ { position: fixed; inset: 0; z-index: 45; background: rgba(8, 3, 10, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; }
#circ[hidden] { display: none; }
.circ-in, .circ-run { align-items: stretch; gap: 12px; max-height: 94vh; overflow-y: auto; }
.circ-modes { display: grid; gap: 8px; }
.circ-modes button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 16px; background: var(--surface2); color: var(--ink); border: 2px solid transparent; box-shadow: none; }
.circ-modes button.on { border-color: var(--hot); background: color-mix(in srgb, var(--hot) 10%, var(--surface2)); }
.circ-modes small { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.circ-list { display: flex; flex-direction: column; gap: 6px; }
.ci { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 14px; background: var(--surface2); font-size: 14px; }
.ci > span:nth-child(3) { flex: 1; }
.ci-n { width: 22px; text-align: center; font-weight: 700; color: var(--hot); }
.ci-fig { width: 64px; flex: none; }
.ci button { width: 28px; height: 28px; min-height: 0; padding: 0; }
.cstep { display: flex; align-items: center; gap: 10px; } .cstep b { min-width: 28px; text-align: center; font-size: 18px; } .cstep button { width: 40px; height: 40px; min-height: 0; padding: 0; }
.ci { text-align: left; }
.circ-run { align-items: center; text-align: center; }
.circ-run > .spread { width: 100%; }
.circ-time { font-family: var(--display); font-size: 72px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.circ-run .progress { width: 100%; }
.circ-run.work .circ-time { color: var(--hot); }
.circ-run.rest .circ-time { color: var(--good); }
.circ-run.rest .progress > div { background: var(--good); }
.circ-run.prep .circ-time { color: var(--warn); }
.circ-fig { width: min(260px, 70vw); }
.circ-ex { font-size: 18px; }
.meal-sheet > *, .circ-in > *, .circ-run > * { flex: none; }
.fig .tieband { fill: none; stroke: var(--hot); stroke-width: 2.2; stroke-linecap: round; }
.pc-fig .fig .tieband{ stroke: #fff; }
/* สีชุดตามเพศ: หญิง = ชมพูธีม + กางเกงม่วงเข้ม / ชาย = เสื้อฟ้าน้ำทะเล + กางเกงกรมท่า */
.fig.female { --top: var(--hot); --btm: #3e2a5e; --hair: #6a4334; }
.fig.male { --top: #2bb3c8; --btm: #24324f; --hair: #4a3438; --shoe: #f4f6fb; }
.fig.male .sole { stroke: #2bb3c8; }
.fig.male .bk .f-tp { fill: color-mix(in srgb, #2bb3c8 65%, #000); }
[data-theme="light"] .fig.male, [data-theme="sakura"] .fig.male { --shoe: #fff; }
.fig .tieband { stroke-width: 1.8; }

.pc-fig .fig.male, .pc-fig .fig.female { --top: #fff; --btm: #2a1a3e; }

/* ===== หน้าอาหาร: แท็บ + ขั้นตอน 1-2-3 ===== */
.food-tabs { margin-top: 2px; }
.add-flow { gap: 12px; }
.step-h { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.step-h b { font-size: 15.5px; }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--hot), var(--hot2)); box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--hot) 70%, transparent); }
.way-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.way { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 4px 10px; border-radius: 16px; background: var(--surface2); color: var(--ink);
  border: 2px solid transparent; box-shadow: none; font: inherit; text-align: center; min-height: 0; }
.way .ic { width: 22px; height: 22px; color: var(--hot); }
.way b { font-size: 13.5px; }
.way small { font-size: 11px; color: var(--muted); font-weight: 400; line-height: 1.2; }
.way.on { border-color: var(--hot); background: color-mix(in srgb, var(--hot) 12%, var(--surface2)); }
.step-ph { padding: 12px 14px; border-radius: 14px; border: 1.5px dashed var(--edge); text-align: center; }
@media (max-width: 360px) { .way-grid { grid-template-columns: repeat(2, 1fr); } }
.add-flow .meal-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; overflow: visible; }
.add-flow .meal-chips .chip { justify-content: center; padding-left: 6px; padding-right: 6px; gap: 4px; }
.region-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .region-chips::-webkit-scrollbar { display: none; }
.add-flow .meal-chips .chip { white-space: nowrap; font-size: 13.5px; }
@media (max-width: 440px) { .add-flow .meal-chips .chip .ic { display: none; } }


/* =================== หน้าเข้าสู่ระบบ / ล็อก PIN =================== */
html.ls-open, html.ls-open body { overflow: hidden; }
#lockscreen { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; overflow-y: auto; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: var(--bg); color: var(--ink); opacity: 0; transition: opacity .3s ease; }
#lockscreen.show { opacity: 1; }
#lockscreen:empty { display: none; }
.ls-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ls-bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: lsFloat 14s ease-in-out infinite alternate; }
.ls-bg i:nth-child(1) { width: 360px; height: 360px; left: -120px; top: -100px; background: var(--hot); }
.ls-bg i:nth-child(2) { width: 300px; height: 300px; right: -110px; top: 30%; background: var(--hot2); animation-delay: -5s; }
.ls-bg i:nth-child(3) { width: 280px; height: 280px; left: 20%; bottom: -140px; background: var(--violet); opacity: .35; animation-delay: -9s; }
@keyframes lsFloat { to { transform: translate(40px, 30px) scale(1.12); } }
.ls-wrap { position: relative; width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 18px; transform: translateY(14px); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
#lockscreen.show .ls-wrap { transform: none; }
.ls-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; }
.ls-brand b { background: linear-gradient(100deg, var(--hot), var(--hot2)); -webkit-background-clip: text; background-clip: text; color: transparent; }


.ls-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }


.ls-hero h1 { font-family: var(--display); font-size: 30px; line-height: 1.2; margin: 0; letter-spacing: -.3px; }
.ls-hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--hot), var(--hot2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ls-hero p { margin: 0; color: var(--muted); font-size: 14.5px; }
.ls-card { width: 100%; box-sizing: border-box; padding: 20px; border-radius: 28px; display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .35); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.is-pin .ls-card { align-items: center; padding: 26px 20px 18px; }
.ls-acct{ display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: var(--surface2); }
.ls-acct div{ display: flex; flex-direction: column; min-width: 0; }
.ls-acct b{ font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-acct small{ font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.ls-acct small .ic { width: 14px; height: 14px; }
.ls-ava { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 19px; color: #fff; background: linear-gradient(135deg, var(--hot), var(--violet)); }
.ls-ava.big { width: 68px; height: 68px; font-size: 28px; box-shadow: 0 12px 28px -10px var(--glow); }
.ls-main { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; border-radius: 18px; font-weight: 800; font-size: 16.5px; color: #fff;
  background: linear-gradient(120deg, var(--hot), var(--hot2)); box-shadow: 0 14px 28px -12px var(--glow); transition: transform .15s; flex-direction: row-reverse; }
.ls-main:active { transform: scale(.97); }
.ls-link { all: unset; cursor: pointer; align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--hot); padding: 4px 8px; }

.ls-lockic { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; color: var(--hot); background: color-mix(in srgb, var(--hot) 14%, transparent); }
.ls-lockic .ic { width: 28px; height: 28px; }
.ls-h { margin: 4px 0 0; font-family: var(--display); font-size: 21px; text-align: center; }
.ls-sub { margin: -6px 0 0; font-size: 13px; color: var(--muted); text-align: center; min-height: 18px; }
.ls-sub.err { color: #e5484d; font-weight: 600; }
.ls-dots { display: flex; gap: 16px; margin: 4px 0 6px; }
.ls-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--hot) 55%, var(--line)); transition: background .15s, transform .15s; }
.ls-dots i.on { background: var(--hot); border-color: var(--hot); transform: scale(1.1); }
.ls-dots.shake { animation: lsShake .4s; }
@keyframes lsShake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.ls-keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; }
.ls-key { all: unset; box-sizing: border-box; cursor: pointer; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 27px;
  background: var(--surface2); color: var(--ink); transition: transform .1s, background .15s; -webkit-tap-highlight-color: transparent; }
.ls-key:active { transform: scale(.92); background: color-mix(in srgb, var(--hot) 22%, var(--surface2)); }
.ls-key.fn { background: transparent; color: var(--muted); }
.ls-key.fn .ic { width: 26px; height: 26px; }
.ls-wait { opacity: .35; pointer-events: none; }
@media (max-height: 700px) {  .ls-hero h1 { font-size: 25px; } .ls-keys { grid-template-columns: repeat(3, 62px); gap: 10px 20px; } .ls-key { width: 62px; height: 62px; font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .ls-bg i { animation: none; } }
[data-theme="neon"] .ls-key, [data-theme="neon"] .ls-link { box-shadow: none !important; }

/* การ์ดบัญชีในหน้า "ฉัน" */







.wk-live { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* =================== ธีม "สปอร์ตดำส้ม" (ember) =================== */
[data-theme="ember"] {
  --bg: #0B0B0D; --surface: #18181b; --surface2: #232328; --ink: #FFFFFF; --muted: #8e8e98; --line: #2b2b31;
  --hot: #FF3D00; --hot2: #ff7a3d; --cool: #6fd3ff; --violet: #b9a2ff; --sun: #ffb347;
  --good: #3ddc97; --warn: #ffb547; --bad: #ff5c5c; --prop: #3a3a42;
  --glass: rgba(12, 12, 14, .82); --glass2: rgba(26, 26, 30, .9); --on-ink: #0c0c0e; color-scheme: dark;
  --edge: rgba(255, 255, 255, .06);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 16px 36px -18px rgba(0, 0, 0, .9);
  --glow: rgba(255, 61, 0, .55);
}
[data-theme="ember"] body::before { background: radial-gradient(60% 35% at 100% 0%, rgba(255, 77, 18, .10), transparent 70%); height: 100vh; inset: 0; }
[data-theme="ember"] .card, [data-theme="ember"] .ex, [data-theme="ember"] .lib-card, [data-theme="ember"] .prog-card { background: var(--surface); border-color: var(--edge); }
[data-theme="ember"] .tabbar { background: rgba(22, 22, 25, .94); border-color: var(--edge); }
[data-theme="ember"] .brand { color: #fff; -webkit-text-fill-color: #fff; background: none; font-weight: 800; letter-spacing: -.3px; }
[data-theme="ember"] .chip.on, [data-theme="ember"] .seg button.on { background: #fff; color: #0c0c0e; box-shadow: none; }
[data-theme="ember"] button:not(.ghost):not(.icon):not(.danger):not(.chip):not(.check):not(.st):not(.cat):not(.choice):not(.bp):not(.theme-btn):not(.wd) { box-shadow: 0 10px 24px -10px var(--glow); }

/* =================== หน้าแรกสไตล์สปอร์ต (kx) =================== */
.kx-num { font-family: var(--display); font-weight: 800; letter-spacing: -1.5px; line-height: .95; font-variant-numeric: tabular-nums; }
.kx-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kx-hello { display: flex; flex-direction: column; min-width: 0; }
.kx-hello span { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
.kx-hello h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kx-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.kx-streak { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 99px; background: var(--surface2); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.kx-streak b { font-family: var(--display); font-size: 17px; }
.kx-streak .ic { color: var(--hot); }
.kx-streak.lit .ic { filter: drop-shadow(0 0 6px var(--glow)); }
.kx-ava { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 19px; color: #fff;
  background: linear-gradient(135deg, var(--hot), color-mix(in srgb, var(--hot) 40%, #2a1a40)); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px color-mix(in srgb, var(--hot) 50%, transparent); }
.kx-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: -2px; }
.kx-week span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; border-radius: 14px; }
.kx-week b { font-family: var(--display); font-weight: 700; font-size: 15px; }
.kx-week span.future b { color: var(--muted); opacity: .7; }
.kx-week i { width: 7px; height: 7px; border-radius: 50%; }
.kx-week i.on { background: var(--hot); box-shadow: 0 0 8px var(--glow); }
.kx-week i.log { background: color-mix(in srgb, var(--hot) 40%, transparent); }
.kx-week span.today { background: var(--surface2); }
.kx-week span.today b { color: var(--hot); }

.kx-hero { position: relative; overflow: hidden; border-radius: 30px; min-height: 300px; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; isolation: isolate;
  background: radial-gradient(90% 80% at 72% 30%, #5a5a60 0%, #2f2f34 45%, #161618 100%); box-shadow: var(--shadow); }
.kx-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, transparent 35%, rgba(10, 10, 12, .78) 100%); }
.kx-art { position: absolute !important; right: -6%; top: 2%; width: 78% !important; max-width: 380px !important; height: auto; z-index: 0 !important; opacity: .92; filter: grayscale(1) contrast(1.05); }
.kx-art svg { width: 100%; height: auto; display: block; }
.kx-hud { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.kx-hud .ln { fill: none; stroke: var(--hot); stroke-width: 1.6; vector-effect: non-scaling-stroke; opacity: .9; }
.kx-hud .ln.th { stroke-width: 3.2; }
.kx-badge { position: absolute; top: 16px; left: 16px; z-index: 2; padding: 7px 12px; border-radius: 12px; background: rgba(12, 12, 14, .82); color: var(--hot); font-family: var(--display); font-weight: 700; font-size: 14px; }
.kx-hb { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 10px; max-width: 100%; }
.kx-hero h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(34px, 10vw, 48px); line-height: 1.02; letter-spacing: -1.2px; color: #fff; text-shadow: 0 4px 24px rgba(0, 0, 0, .45); }
.kx-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-right: 120px; }
.kx-chips span { padding: 7px 13px; border-radius: 99px; background: rgba(12, 12, 14, .7); color: #fff; font-size: 13.5px; font-weight: 600; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.kx-prog { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; max-width: 60%; }
.kx-prog i { display: block; height: 100%; background: var(--hot); }
.kx-start { all: unset; box-sizing: border-box; cursor: pointer; position: absolute; z-index: 3; right: 16px; bottom: 18px; display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px 0 24px;
  border-radius: 99px; background: #fff; color: #0c0c0e; font-family: var(--display); font-weight: 800; font-size: 17px; text-decoration: none; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); transition: transform .15s; }
.kx-start:active { transform: scale(.95); }
.kx-start .ic { width: 20px; height: 20px; stroke-width: 2.6; }

.kx-bento { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 12px; }
.kx-cal { grid-row: span 2; position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 18px 16px; border-radius: 26px; background: var(--surface); color: var(--ink); text-decoration: none; min-height: 250px; overflow: hidden; }
.kx-lbl { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--hot); }
.kx-dots { position: absolute; right: 14px; top: 18px; display: grid; grid-template-columns: repeat(3, 6px); gap: 5px 4px; }
.kx-dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--hot) 16%, transparent); }
.kx-dots i.on { background: var(--hot); animation: kxDot .4s ease-out both; animation-delay: var(--d); }
@keyframes kxDot { from { transform: scale(.2); opacity: 0; } }
.kx-cal-b { display: flex; flex-direction: column; gap: 4px; padding-right: 34px; margin-top: auto; }
.kx-cal-b .kx-num { font-size: clamp(38px, 11vw, 52px); }
.kx-cal-b span { font-family: var(--display); font-weight: 700; font-size: 15px; }
.kx-cal-b small { font-size: 12px; color: var(--muted); }
.kx-mac { border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kx-time { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 16px; border-radius: 26px; background: var(--hot); color: #120400; text-decoration: none; min-height: 118px; }
.kx-time .kx-num { font-size: clamp(42px, 12vw, 56px); color: #0c0c0e; }
.kx-time .kx-num small { font-size: 16px; letter-spacing: 0; margin-left: 4px; font-weight: 700; }
.kx-time span { font-weight: 700; font-size: 13px; }
.kx-steps { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 16px; border-radius: 26px; background: #fff; color: #0c0c0e; text-decoration: none; min-height: 118px; }
.kx-st-top { display: flex; align-items: flex-end; gap: 8px; }
.kx-steps .kx-num { font-size: clamp(38px, 11vw, 52px); }
.kx-steps svg { flex: 1; height: 30px; min-width: 30px; overflow: visible; }
.kx-steps polyline { fill: none; stroke: #0c0c0e; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.kx-steps span { font-size: 12.5px; font-weight: 700; }

.kx-water { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 22px; background: var(--surface); }
.kx-wic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #4fb8ff; background: rgba(79, 184, 255, .14); flex-shrink: 0; }
.kx-wb { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.kx-wb b { font-family: var(--display); font-size: 18px; color: var(--ink); }
.kx-wb i { display: block; height: 6px; border-radius: 99px; background: rgba(79, 184, 255, .14); overflow: hidden; }
.kx-wb em { display: block; height: 100%; background: #4fb8ff; border-radius: inherit; }
.kx-wadd, .kx-wminus { all: unset; cursor: pointer; height: 38px; padding: 0 14px; border-radius: 99px; background: var(--surface2); color: var(--ink); font-weight: 700; font-size: 13.5px; display: grid; place-items: center; box-shadow: none !important; }
.kx-wminus { width: 38px; padding: 0; }

.kx-cats { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 4px -16px 0; padding: 0 16px; }
.kx-cats::-webkit-scrollbar { display: none; }
.kx-cats button { all: unset; cursor: pointer; flex-shrink: 0; padding: 11px 20px; border-radius: 99px; background: var(--surface); color: var(--muted); font-weight: 700; font-size: 15px; box-shadow: none !important; transition: background .2s, color .2s; }
.kx-cats button.on { background: #fff; color: #0c0c0e; }
.kx-list { display: flex; flex-direction: column; gap: 10px; }
.kx-item { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 22px; background: var(--surface); box-shadow: none !important; transition: transform .15s; }
.kx-item:active { transform: scale(.98); }
.kx-thumb { width: 84px; height: 64px; border-radius: 14px; overflow: hidden; background: radial-gradient(80% 90% at 60% 40%, #4a4a50, #1e1e22); display: grid; place-items: center; }
.kx-thumb svg { width: 100%; height: 100%; filter: grayscale(1) brightness(1.25); }
.kx-it { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kx-it b { font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kx-it small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kx-play { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--hot); color: #fff; box-shadow: 0 8px 20px -8px var(--glow); }
.kx-play .ic { width: 20px; height: 20px; fill: currentColor; }
@media (min-width: 640px) { .kx-hero { min-height: 340px; } .kx-art { width: 62% !important; } }
@media (max-width: 360px) { .kx-chips { padding-right: 0; } .kx-start { position: relative; right: auto; bottom: auto; align-self: flex-start; z-index: 3; } }
.kx-thumb .fig .gr, .kx-thumb .fig .fnb, .kx-thumb .fig .fnt, .kx-thumb text { display: none; }
.kx-cal-b { padding-right: 40px; }
.kx-cal-b span { font-size: 13.5px; line-height: 1.3; }
.kx-mac { display: flex; align-items: baseline; gap: 12px; font-size: 12px; }
.kx-mac span { display: inline-flex; align-items: baseline; gap: 2px; color: var(--muted); }
.kx-mac b { font-family: var(--display); font-size: 16px; color: var(--ink); }
.kx-mac small { margin-left: auto; }
.kx-hero .kx-art { top: auto; bottom: 22%; }
.kx-dots { top: 54px; } .kx-cal { min-height: 268px; }

/* ภาพตัวละครในการ์ดเวิร์กเอาต์: ใช้สีจริง ขยับท่าวนไป มีแสงส้มด้านหลัง */
.kx-hero { background: radial-gradient(120% 90% at 75% 20%, #2a2a2f 0%, #18181b 55%, #111113 100%); }
.kx-art { position: absolute !important; right: -2%; top: 6%; bottom: auto; width: 64% !important; max-width: 340px !important; z-index: 0 !important; opacity: 1; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .55)); animation: kxFloat 4.5s ease-in-out infinite; }
.kx-hero .kx-art { top: 6%; bottom: auto; }
.kx-art svg { position: relative; z-index: 1; }
.kx-glow { position: absolute; z-index: 0; left: 50%; top: 52%; width: 86%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--hot) 55%, transparent) 0%, color-mix(in srgb, var(--hot) 18%, transparent) 45%, transparent 70%); filter: blur(6px); animation: kxPulse 3s ease-in-out infinite; }
.kx-art .fig .gr { opacity: .35; }
.kx-art .fig .fnb, .kx-art .fig .fnt, .kx-art text { display: none; }
@keyframes kxFloat { 50% { transform: translateY(-5px); } }
@keyframes kxPulse { 50% { opacity: .65; transform: translate(-50%, -50%) scale(.94); } }
.kx-hud .ln { opacity: .55; }
.kx-hud circle.ln { transform-origin: 150px 120px; transform-box: view-box; animation: kxSpin 9s linear infinite; stroke-dasharray: 18 8; }
@keyframes kxSpin { to { transform: rotate(360deg); } }
.kx-hero::after { background: linear-gradient(180deg, transparent 30%, rgba(10, 10, 12, .55) 62%, rgba(10, 10, 12, .9) 100%); }
@media (prefers-reduced-motion: reduce) { .kx-art, .kx-glow, .kx-hud circle.ln { animation: none; } }
@media (min-width: 640px) { .kx-art { width: 52% !important; } }
.kx-art { -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 100%); mask-image: linear-gradient(180deg, #000 78%, transparent 100%); }
.kx-chips span { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .08); }
.kx-hud .ln { opacity: .4; }

/* =================== สมัครสมาชิก / เข้าสู่ระบบ =================== */
.au-hero h1 { font-size: 26px; }
.au-hero { margin-bottom: -4px; }
.is-login .ls-card { padding: 18px 18px 16px; gap: 12px; }
.au-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 16px; background: var(--surface2); }
.au-tabs button { all: unset; position: relative; z-index: 1; cursor: pointer; text-align: center; padding: 10px 0; font-weight: 700; font-size: 14.5px; color: var(--muted); transition: color .2s; box-shadow: none !important; }
.au-tabs button.on { color: var(--on-ink, #111); }
.au-tabs i { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 12px; background: #fff; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.au-tabs i.signup { transform: translateX(100%); }
.au-form { display: flex; flex-direction: column; gap: 12px; animation: auIn .3s ease; }
@keyframes auIn { from { opacity: 0; transform: translateY(6px); } }
.au-f { display: flex; flex-direction: column; gap: 6px; }
.au-f > span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.au-in { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 6px 0 14px; border-radius: 14px; background: var(--surface2); border: 1.5px solid transparent; transition: border-color .2s, background .2s; }
.au-in:focus-within { border-color: var(--hot); background: color-mix(in srgb, var(--hot) 6%, var(--surface2)); }
.au-in > .ic { color: var(--muted); flex-shrink: 0; }
.au-in input { all: unset; flex: 1; min-width: 0; height: 100%; font-size: 16px; color: var(--ink); }
.au-in input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.au-eye { all: unset; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); box-shadow: none !important; }
.au-meter { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 5px; align-items: center; margin-top: -4px; }
.au-meter i { height: 4px; border-radius: 4px; background: var(--line); transition: background .25s; }
.au-meter span { font-size: 11.5px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.au-meter.s1 i:nth-child(-n+1) { background: #ff5c5c; } .au-meter.s2 i:nth-child(-n+2) { background: #ffb347; }
.au-meter.s3 i:nth-child(-n+3) { background: #7ccf5b; } .au-meter.s4 i { background: #2fbf8f; }
.au-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.au-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.au-check input { width: 18px; height: 18px; accent-color: var(--hot); margin: 0; }
.au-check a { color: var(--hot); margin-left: 4px; }
.au-link { all: unset; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--hot); box-shadow: none !important; }
.au-msg { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.au-msg.err { background: rgba(229, 72, 77, .14); color: #ff7a7e; }
.au-msg.ok { background: rgba(47, 191, 143, .14); color: #3ddc97; }
.au-submit[disabled] { opacity: .7; cursor: progress; }
.au-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: kxSpin .8s linear infinite; }
.au-or { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.au-google { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; height: 50px; border-radius: 16px; background: #fff; color: #1f1f1f; font-weight: 700; font-size: 15px; box-shadow: none !important; }
.au-google svg { width: 20px; height: 20px; }
.au-google[disabled] { opacity: .45; cursor: not-allowed; }
.au-guest { all: unset; cursor: pointer; align-self: center; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 4px; box-shadow: none !important; }
.au-head { display: flex; gap: 10px; align-items: flex-start; }
.au-head h2 { margin: 2px 0 4px; font-size: 20px; font-family: var(--display); }
.au-head p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.au-back { all: unset; cursor: pointer; width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--surface2); box-shadow: none !important; }
.au-mode { margin: 0; text-align: center; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 4px; }
.au-mode.ok { color: #3ddc97; }
.au-check { flex-direction: row !important; align-items: center !important; text-align: left; }
.au-check span { flex: 1; }
.is-login .ls-card, .au-form, .au-tabs { min-width: 0; max-width: 100%; box-sizing: border-box; }
.au-in input { width: 100%; }
.kx-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 20%; z-index: 0; filter: grayscale(1) contrast(1.08); animation: kxZoom 14s ease-in-out infinite alternate; }
@keyframes kxZoom { to { transform: scale(1.06); } }
.kx-thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }

/* =================== แบรนด์ KYNVOK =================== */
.kyn-logo { display: inline-flex; align-items: center; gap: .42em; color: var(--ink); line-height: 1; }
.kyn-mark { height: 1.15em; width: auto; flex-shrink: 0; display: block; }
.kyn-word { font-family: "Montserrat", "Arial Black", var(--display); font-weight: 800; letter-spacing: .04em; font-size: 1em; }
.topbar .brand { font-size: 19px; background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--ink) !important; }
.topbar .brand .kyn-logo { gap: .45em; }
.ls-brand .kyn-logo.big { font-size: 30px; color: #fff; }
.ls-brand b { background: none; -webkit-text-fill-color: currentColor; color: #fff; }

/* การ์ดบัญชีและความปลอดภัย (แบบรายการตั้งค่า) */









.sc-badge { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 99px; }
.sc-badge.ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }

.sc-item { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; cursor: default; box-shadow: none !important; }
button.sc-item { cursor: pointer; }
button.sc-item:active { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.sc-item + .sc-item { border-top: 1px solid var(--line); }
.sc-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--hot); background: color-mix(in srgb, var(--hot) 12%, transparent); }
.sc-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sc-tx b { font-size: 15px; font-weight: 600; }
.sc-tx small { font-size: 12px; color: var(--muted); }
.sc-chev { color: var(--muted); display: grid; }
.sc-sel { width: auto !important; min-width: 0; padding: 6px 28px 6px 10px !important; border-radius: 10px; font-size: 14px; }
.sc-sw { pointer-events: none; }
.sc-item.danger .sc-ic { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.sc-item.danger b { color: var(--bad); }

.hx-sw { display: inline-block; width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex-shrink: 0; }
.hx-sw i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.hx-sw.on { background: var(--hot); }
.hx-sw.on i { transform: translateX(18px); }


/* =================== หน้าแรก: ส่วนที่เคยเป็นสีดำ/ขาวตายตัว ให้เปลี่ยนตามธีม =================== */
/* การ์ดเวิร์กเอาต์: ธีมอื่นใช้สีหลักของธีมไล่เข้ม · ธีม KYNVOK ใช้ดำเทาแบบเดิม */
.kx-hero { background: radial-gradient(120% 100% at 80% 12%, var(--hot2) 0%, var(--hot) 42%, color-mix(in srgb, var(--hot) 52%, #000) 100%); }
.kx-hero::after { background: linear-gradient(180deg, transparent 35%, color-mix(in srgb, color-mix(in srgb, var(--hot) 45%, #000) 75%, transparent) 100%); }
.kx-hud .ln { stroke: rgba(255, 255, 255, .7); }
.kx-glow { background: radial-gradient(circle, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, .12) 45%, transparent 70%); }
.kx-badge { background: rgba(255, 255, 255, .94); color: var(--hot); }
.kx-chips span { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .22); }
.kx-start { color: var(--hot); }
.kx-photo { filter: grayscale(.3) contrast(1.05); }
[data-theme="ember"] .kx-hero { background: radial-gradient(120% 90% at 75% 20%, #2a2a2f 0%, #18181b 55%, #111113 100%); }
[data-theme="ember"] .kx-hero::after { background: linear-gradient(180deg, transparent 30%, rgba(10, 10, 12, .55) 62%, rgba(10, 10, 12, .9) 100%); }
[data-theme="ember"] .kx-hud .ln { stroke: var(--hot); }
[data-theme="ember"] .kx-glow { background: radial-gradient(circle, color-mix(in srgb, var(--hot) 55%, transparent) 0%, color-mix(in srgb, var(--hot) 18%, transparent) 45%, transparent 70%); }
[data-theme="ember"] .kx-badge { background: rgba(12, 12, 14, .82); }
[data-theme="ember"] .kx-chips span { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .08); }
[data-theme="ember"] .kx-start { color: #0c0c0e; }
[data-theme="ember"] .kx-photo { filter: grayscale(1) contrast(1.08); }

/* กล่องเวลา (สีหลัก): ตัวหนังสือขาว · KYNVOK ใช้ดำ */
.kx-time { background: linear-gradient(140deg, var(--hot), var(--hot2)); color: #fff; }
.kx-time .kx-num { color: #fff; }
[data-theme="ember"] .kx-time { background: var(--hot); color: #120400; }
[data-theme="ember"] .kx-time .kx-num { color: #0c0c0e; }

/* กล่องก้าว: ธีมสว่างใช้พื้นการ์ดปกติ · ธีมมืดใช้การ์ดขาวตามแบบ */
.kx-steps { background: var(--surface); color: var(--ink); border: 1px solid var(--edge, var(--line)); }
.kx-steps polyline { stroke: var(--hot); }
[data-theme="ember"] .kx-steps, [data-theme="neon"] .kx-steps, [data-theme="midnight"] .kx-steps, [data-theme="ocean"] .kx-steps, [data-theme="forest"] .kx-steps, [data-theme="sunset"] .kx-steps { background: #fff; color: #0c0c0e; border: 0; }
[data-theme="ember"] .kx-steps polyline { stroke: #0c0c0e; }

/* ชิปหมวดที่เลือก: ใช้สีตัวอักษรของธีมเป็นพื้น (ธีมมืด = ขาว, ธีมสว่าง = เข้ม) */
.kx-cats button { background: var(--surface); border: 1px solid var(--edge, var(--line)); }
.kx-cats button.on { background: var(--ink); color: var(--bg); border-color: transparent; }

/* ภาพย่อในรายการ: พื้นอมสีธีม ตัวละครสีจริง · KYNVOK เป็นขาวดำ */
.kx-thumb { background: radial-gradient(90% 100% at 60% 30%, color-mix(in srgb, var(--hot) 22%, var(--surface2)), var(--surface2)); }
.kx-thumb svg { filter: none; }
[data-theme="ember"] .kx-thumb { background: radial-gradient(80% 90% at 60% 40%, #4a4a50, #1e1e22); }
[data-theme="ember"] .kx-thumb svg { filter: grayscale(1) brightness(1.25); }
.kx-play { background: linear-gradient(140deg, var(--hot), var(--hot2)); }
[data-theme="ember"] .kx-play { background: var(--hot); }
.kx-item { border: 1px solid var(--edge, var(--line)); }
[data-theme="ember"] .kx-item { border: 0; }

/* =================== หน้า "ฉัน" แบบหน้าโปรไฟล์ของเว็บแอปทั่วไป =================== */
.me-head { position: relative; border-radius: 26px; background: var(--surface); border: 1px solid var(--edge, var(--line)); box-shadow: var(--shadow); overflow: hidden; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.me-cover { position: relative; height: 96px; margin: 0 -16px; overflow: hidden;
  background: radial-gradient(120% 140% at 90% 0%, var(--hot2), var(--hot) 45%, color-mix(in srgb, var(--hot) 50%, #000) 100%); }
[data-theme="ember"] .me-cover { background: radial-gradient(120% 140% at 90% 0%, #3a3a40, #1c1c20 55%, #121214); }
.me-cover::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-55deg, transparent 0 14px, rgba(255, 255, 255, .06) 14px 16px); }
.me-wm { position: absolute; right: -10px; top: -14px; height: 130px; width: auto; opacity: .16; }
.me-id { display: flex; align-items: flex-end; gap: 12px; margin-top: -38px; position: relative; z-index: 1; }
.me-ava { width: 78px; height: 78px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 32px; color: #fff;
  background: linear-gradient(135deg, var(--hot), var(--violet)); box-shadow: 0 0 0 4px var(--surface), 0 10px 24px -10px var(--glow); }
.me-nm { flex: 1; min-width: 0; padding-bottom: 4px; display: flex; flex-direction: column; }
.me-nm h1 { margin: 0; font-family: var(--display); font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-nm small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-edit { all: unset; cursor: pointer; flex-shrink: 0; margin-bottom: 4px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 700;
  background: var(--surface2); color: var(--ink); box-shadow: none !important; }
.me-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.me-tags span { padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface2); color: var(--muted); }
.me-tags .me-lv { background: color-mix(in srgb, var(--hot) 14%, transparent); color: var(--hot); }
.me-xp { height: 6px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.me-xp i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hot), var(--hot2)); }
.me-xpt { font-size: 11.5px; color: var(--muted); margin-top: -4px; }
.me-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.me-stats div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.me-stats div + div { border-left: 1px solid var(--line); }
.me-stats b { font-family: var(--display); font-weight: 800; font-size: 21px; font-variant-numeric: tabular-nums; }
.me-stats span { font-size: 11.5px; color: var(--muted); }
.me-h { margin: 0; font-size: 17px; }
.me-goal, .me-day { gap: 12px; }
.me-wrow { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.me-wrow div { display: flex; flex-direction: column; gap: 2px; }
.me-wrow small { font-size: 12px; color: var(--muted); }
.me-wrow b { font-family: var(--display); font-weight: 800; font-size: 22px; }
.me-wrow b.hot { color: var(--hot); }
.me-kcal { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; }
.me-kcal b { font-family: var(--display); font-weight: 800; font-size: 38px; letter-spacing: -1px; line-height: 1; }
.me-kcal span { font-size: 14px; font-weight: 600; }
.me-kcal small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: 4px; }
.me-macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.me-macros div { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-radius: 14px; background: color-mix(in srgb, var(--c) 12%, var(--surface2)); border-top: 3px solid var(--c); }
.me-macros b { font-family: var(--display); font-weight: 800; font-size: 19px; }
.me-macros span { font-size: 11px; color: var(--muted); }
.me-cap { margin: 10px 4px -4px; font-size: 12.5px; font-weight: 700; letter-spacing: .4px; color: var(--muted); text-transform: uppercase; }
.me-group { border-radius: 20px; background: var(--surface); border: 1px solid var(--edge, var(--line)); box-shadow: var(--shadow); overflow: hidden; }
.me-group .sc-item { background: transparent; }
.me-group .sc-item + .sc-item, .me-group .acc + .acc, .me-group .sc-item + .acc { border-top: 1px solid var(--line); }
.me-group .acc { border: 0; border-radius: 0; box-shadow: none; background: transparent !important; }
.me-group .acc + .acc { border-top: 1px solid var(--line); }
.me-group .acc-h { padding: 12px 14px; }
.me-group .acc-h .hic { width: 34px; height: 34px; border-radius: 10px; }
.me-group .acc-b { border-top: 1px dashed var(--line); }
.me-group .sc-item.danger { border-top: 0 !important; }
.me-foot { margin: 12px 0 6px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.7; }
.me-foot span { font-size: 11px; opacity: .8; }
.me-fm { height: 13px; width: auto; display: inline-block; vertical-align: -2px; margin-right: 4px; color: var(--ink); }
@media (max-width: 380px) { .me-edit span { display: none; } .me-stats b { font-size: 18px; } .me-macros { grid-template-columns: repeat(2, 1fr); } }

/* หน้าเข้าสู่ระบบ: ให้เข้ากับทุกธีม (ธีมสว่างเดิมโลโก้กับแท็บที่เลือกเป็นสีขาวจนมองไม่เห็น) */
.ls-brand .kyn-logo.big, .ls-brand .kyn-logo.big .kyn-word { color: var(--ink) !important; -webkit-text-fill-color: currentColor !important; }
.ls-bg i { opacity: .28; }
[data-theme="ember"] .ls-bg i, [data-theme="neon"] .ls-bg i, [data-theme="midnight"] .ls-bg i, [data-theme="ocean"] .ls-bg i, [data-theme="forest"] .ls-bg i, [data-theme="sunset"] .ls-bg i { opacity: .5; }
.au-tabs i { background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.au-tabs button.on { color: var(--ink); }
.au-check input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px; border: 2px solid color-mix(in srgb, var(--muted) 70%, transparent); background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.au-check input:checked { background: var(--hot); border-color: var(--hot); }
.au-check input:checked::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.au-in { border-color: color-mix(in srgb, var(--line) 60%, transparent); }
.au-google { border: 1px solid #dadce0; }
.au-check input { appearance: auto; -webkit-appearance: checkbox; width: 18px; height: 18px; border: 0; background: none; accent-color: var(--hot); }
.au-check input:checked::after { content: none; }
.me-group .sc-item.danger { border: 0 !important; background: transparent !important; border-radius: 0 !important; }
/* ปุ่มใส่/เปลี่ยนรูปบนการ์ดเวิร์กเอาต์ */
.kx-ptools { position: absolute; top: 14px; right: 14px; z-index: 4; display: flex; gap: 6px; }


.kx-photo { z-index: 0; }
.kx-hero:has(.kx-photo) .kx-hud .ln { opacity: .55; }

/* สไลด์ภาพในการ์ดเวิร์กเอาต์ */
.kx-slides { position: absolute; inset: 0; z-index: 0; }
.kx-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; pointer-events: none; }
.kx-slide.on { opacity: 1; }
.kx-slide .kx-art { transform: translateX(14px); transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.kx-slide.on .kx-art { transform: none; }
.kx-slide .kx-photo { transform: scale(1.06); transition: transform 6s ease-out; animation: none; }
.kx-slide.on .kx-photo { transform: scale(1); }
.kx-sdots { position: absolute; z-index: 4; top: 58px; left: 16px; display: flex; gap: 4px; }
.kx-sdots button { all: unset; cursor: pointer; padding: 6px 2px; box-shadow: none !important; }
.kx-sdots i { display: block; width: 14px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .4); transition: width .3s, background .3s; }
.kx-sdots button.on i { width: 26px; background: #fff; }
.kx-now { display: inline-flex; align-self: flex-start; gap: 6px; align-items: baseline; padding: 5px 11px; border-radius: 99px; font-size: 12.5px; color: #fff; background: rgba(0, 0, 0, .3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); margin-bottom: -4px; }
.kx-now b { font-weight: 800; color: #fff; }
[data-theme="ember"] .kx-now b { color: var(--hot); }
@media (prefers-reduced-motion: reduce) { .kx-slide, .kx-slide .kx-art, .kx-slide .kx-photo { transition: none; } }

/* สลับภาษา */
.lang-seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--surface2); gap: 2px; }
.lang-seg button, .ls-lang button { all: unset; cursor: pointer; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; color: var(--muted); box-shadow: none !important; }
.lang-seg button.on { background: var(--hot); color: #fff; }
.ls-lang { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 3; display: inline-flex; padding: 3px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.ls-lang button.on { background: var(--ink); color: var(--bg); }
/* การแจ้งเตือนบนหน้าแรก: อยู่ใต้แถววัน แบบแถบกะทัดรัด */
.kx-rems { display: flex; flex-direction: column; gap: 8px; }
.kx-rems:empty { display: none; }
.kx-rems .remind { margin: 0; padding: 10px 12px; border-radius: 16px; font-size: 13.5px; gap: 10px; min-height: 0; }
.kx-rems .remind .remind-ic { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; }
.kx-rems .remind-btn { padding: 6px 12px; font-size: 12.5px; }
/* verified food badge */
.vbadge{display:inline-flex;align-items:center;gap:2px;margin-left:6px;padding:1px 6px;border-radius:99px;font-size:10px;font-weight:700;background:color-mix(in srgb,var(--ok,#1f9d55) 16%,transparent);color:var(--ok,#1f9d55);vertical-align:middle}
.vbadge .ic{width:10px;height:10px}
/* kx-cal: ring แทนจุด, การ์ดก้าวมีแถบเป้า */
.kx-cal-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kx-ring { width: 64px; height: 64px; transform: rotate(-90deg); flex: none; }
.kx-ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.kx-ring .tr { stroke: color-mix(in srgb, var(--hot) 15%, transparent); }
.kx-ring .pr { stroke: var(--hot); transition: stroke-dasharray .6s ease; }
.kx-cal { min-height: 0; justify-content: flex-start; }
.kx-cal-b { margin-top: auto; padding-right: 0; }
.kx-st-top { display: flex; align-items: center; gap: 10px; }
.kx-st-bar { height: 6px; border-radius: 99px; background: color-mix(in srgb, currentColor 10%, transparent); overflow: hidden; }
.kx-st-bar i { display: block; height: 100%; border-radius: inherit; background: var(--hot); }
/* kx-cal: แท่งแนวตั้งเติมจากล่างตาม % ที่กิน */
.kx-vbar { position: absolute; right: 16px; top: 18px; bottom: 18px; width: 12px; border-radius: 99px; background: color-mix(in srgb, var(--hot) 14%, transparent); overflow: hidden; display: flex; align-items: flex-end; }
.kx-vbar i { display: block; width: 100%; border-radius: inherit; background: linear-gradient(to top, var(--hot), var(--hot2, var(--hot))); transition: height .6s ease; }
.kx-cal .kx-lbl, .kx-cal-b, .kx-mac { padding-right: 26px; }
/* แท่งอยู่ข้างตัวเลข ไม่ลงไปทับแถวสารอาหาร */
.kx-cal-main { flex: 1; display: grid; grid-template-columns: 1fr 8px; gap: 12px; min-height: 0; }
.kx-cal-l { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; }
.kx-cal .kx-vbar { position: static; width: 8px; height: auto; }
.kx-cal .kx-lbl, .kx-cal-b, .kx-mac { padding-right: 0; }
.kx-cal-b { margin-top: 0; }
/* การ์ดก้าวในธีมมืด: ใช้พื้นเข้มเข้าชุดกับการ์ดอื่น */
[data-theme="ember"] .kx-steps, [data-theme="neon"] .kx-steps, [data-theme="midnight"] .kx-steps, [data-theme="ocean"] .kx-steps, [data-theme="forest"] .kx-steps, [data-theme="sunset"] .kx-steps { background: var(--surface); color: var(--ink); border: 1px solid var(--edge, var(--line)); }
[data-theme="ember"] .kx-steps polyline { stroke: var(--hot); }
/* ภาพวันพัก */
.kx-hero.rest .kx-photo { object-position: 60% 40%; }
/* แจ้งเตือนจอดับระหว่างฝึก */
.wake-tip { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 4px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--hot) 12%, transparent); font-size: 12.5px; line-height: 1.45; }
.wake-tip .icon { margin-left: auto; flex: none; }
/* ชิปไม่ให้มุดใต้ปุ่มเริ่ม */
.kx-chips span { white-space: nowrap; }
.kx-hero.rest .kx-chips { padding-right: 180px; }
@media (max-width: 360px) { .kx-hero.rest .kx-chips { padding-right: 0; } }
.kx-now { display: inline-block; max-width: calc(100% - 4px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kx-now b { margin-right: 4px; }
/* ไอคอนอาหาร: ใหญ่ขึ้น มีเงา */
.fart svg { width: 42px; height: 42px; filter: drop-shadow(0 2px 2.5px rgba(0, 0, 0, .28)); }
.fart.xs svg { width: 22px; height: 22px; filter: none; }
.md-item .fart svg { width: 34px; height: 34px; }
/* ภาพย่อตัวการ์ตูนในรายการหน้าแรก: แสดงสีจริงทุกธีม */
.kx-thumb svg, [data-theme="ember"] .kx-thumb svg { filter: none; }
