/* AIDailyTH · พื้นที่สมาชิก v2 (/me, /me/*, /admin) · โหลดต่อจาก site.css เฉพาะหน้าสมาชิก/แอดมิน
   ต้นแบบที่อนุมัติ: data/drafts/site/2026-10-02_member-v2/member.css (ส่วน 2-4 ยกมาตรงตัว ตัดแถบต้นแบบและส่วนบทความออก)
   หน้าใช้ <body class="mem"> · ห้าม style="" (CSP) */

:root {
  --f-head: var(--font-head); --f-body: var(--font-body); --f-mono: var(--font-mono);
  --t-xs: 13px; --t-sm: 15px; --t-md: 17px; --t-lg: 20px;
  --t-page: clamp(30px, 3vw, 40px);
  --tabbar: 64px;
  --s10: 128px;
}

/* ---------- พื้นฐานของหน้าสมาชิก (specificity ต่ำ ไม่ทับปุ่ม/ชิปของ site.css) ---------- */
:where(.mem) a { color: inherit; text-decoration: none; }
:where(.mem) p { margin: 0; }
:where(.mem) ul, :where(.mem) ol { margin: 0; padding: 0; list-style: none; }
:where(.mem) button, :where(.mem) input, :where(.mem) select, :where(.mem) textarea { font: inherit; color: inherit; }
.mem .wrap { width: 100%; }
.mem .kicker { display: inline; margin: 0; font-size: var(--t-xs); letter-spacing: .08em; }
.mem .chip { height: 26px; padding: 0 var(--s2); font-size: 12px; background: rgb(var(--ink-rgb) / .02); }
.mem .chip.count { background: transparent; }

/* หัวเว็บสมาชิก (เมนูซ้าย + ปุ่มบัญชีขวา) */
.mem .site-head .wrap { gap: var(--s6); height: 68px; }
.mem .nav { gap: var(--s5); margin-left: 0; margin-right: auto; }
.mem .nav > a { padding: 0; border-radius: 0; font-size: var(--t-sm); }
.mem .nav-auth { display: none; }
.head-act { display: flex; align-items: center; gap: var(--s2); }
.mem .site-head .brand { text-decoration: none; }

/* ท้ายเว็บสมาชิก (3 คอลัมน์) */
.mem .site-foot { margin-top: var(--s9); padding: var(--s7) 0; font-size: var(--t-sm); color: var(--muted); }
.mem .site-foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s6); align-items: start; }
.mem .site-foot .about p { margin-top: var(--s3); max-width: 28em; }
.mem .site-foot h4 { margin: 0 0 var(--s3); font: 400 var(--t-xs)/1 var(--f-body); letter-spacing: .08em; color: var(--faint); }
.mem .site-foot li + li { margin-top: var(--s2); }
.mem .site-foot .copyright { grid-column: 1 / -1; padding-top: var(--s5); border-top: 1px solid var(--line); color: var(--faint); font-size: var(--t-xs); }

/* สถานะโหลด / ยังไม่เข้าสู่ระบบ */
.m-loading { padding: var(--s9) 0; text-align: center; color: var(--faint); }
.m-guest { max-width: 560px; margin: var(--s8) auto 0; padding: var(--s7) var(--s6); text-align: center; }
.m-guest h1 { font-size: var(--t-page); margin-top: var(--s3); }
.m-guest p { margin-top: var(--s3); }
.m-guest .btn { margin-top: var(--s5); }
.m-err { margin-top: var(--s3); font-size: var(--t-xs); color: var(--danger); min-height: 1em; }
.form-act .msg { color: var(--faint); }

/* หัวเว็บสมาชิก · อวาตาร์ */
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--butter), var(--peach)); color: var(--text); font: 700 15px/1 var(--f-head); border: 1px solid var(--line-strong); }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.avatar.md { width: 44px; height: 44px; font-size: 18px; }
.me-btn { display: inline-flex; align-items: center; gap: var(--s2); padding: 4px 4px 4px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: var(--t-sm); color: var(--text); }
.me-btn:hover { border-color: var(--line-strong); }
.me-btn .avatar { width: 32px; height: 32px; font-size: 14px; }
.nav a { position: relative; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -23px; height: 2px; background: var(--accent); border-radius: 2px; }

/* แถบแท็บล่าง (มือถือ) */
.tabbar { display: none; }
.tabbar svg, .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* หัวหน้า */
.page { padding: var(--s7) 0 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s6); }
.page-head h1 { font-size: var(--t-page); line-height: 1.25; }
.page-head p { margin-top: var(--s2); font-size: var(--t-md); }
.sub { padding-top: var(--s8); }
.sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.sub-head h2 { font-size: 24px; }
.sub-head p { font-size: var(--t-sm); }
.more { font-size: var(--t-sm); color: var(--muted); white-space: nowrap; }
.more:hover { color: var(--text); }

/* แถบความคืบหน้า */
.bar { height: 6px; border-radius: 999px; background: rgb(var(--ink-rgb) / .08); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.w8 { width: 8%; } .w17 { width: 17%; } .w25 { width: 25%; } .w33 { width: 33%; } .w42 { width: 42%; } .w50 { width: 50%; }
.w60 { width: 60%; } .w67 { width: 67%; } .w75 { width: 75%; } .w83 { width: 83%; } .w100 { width: 100%; }

/* ทักทาย + สถิติ */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s6); padding-bottom: var(--s6); border-bottom: 1px solid var(--line); }
.hello h1 { font-size: var(--t-page); line-height: 1.25; }
.hello p { margin-top: var(--s2); }
.stats { display: flex; gap: var(--s2); }
.stats li { min-width: 120px; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-in); background: var(--surface); }
.stats b { display: block; font: 700 24px/1.2 var(--f-head); }
.stats span { font-size: var(--t-xs); color: var(--faint); }

/* การ์ดคอร์สของฉัน */
.course-card { display: grid; grid-template-columns: 148px 1fr 340px; gap: var(--s6); padding: var(--s6); border-color: var(--accent-line); background: linear-gradient(120deg, rgba(255, 225, 26, .06), transparent 45%), var(--surface); position: relative; overflow: hidden; }
.course-card .cover { width: 148px; border-radius: 3px 8px 8px 3px; box-shadow: var(--shadow); transform: rotate(-3deg); align-self: start; margin-top: var(--s2); }
.course-card h3 { font-size: 26px; margin: var(--s3) 0 var(--s2); line-height: 1.35; }
.course-card .next { margin-top: var(--s5); padding: var(--s4); border-radius: var(--r-in); background: var(--surface-2); border: 1px solid var(--line); }
.course-card .next small { display: block; font-size: var(--t-xs); color: var(--faint); }
.course-card .next b { display: block; font: 700 var(--t-md)/1.5 var(--f-head); margin-top: 2px; }
.course-card .acts { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.prog-row { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); font-size: var(--t-sm); }
.prog-row .bar { flex: 1; max-width: 320px; }
.prog-row b { font-family: var(--f-head); font-weight: 700; }
.lessons { border-left: 1px solid var(--line); padding-left: var(--s6); }
.lessons h4 { font: 400 var(--t-xs)/1 var(--f-body); letter-spacing: .08em; color: var(--faint); margin-bottom: var(--s3); }
.lessons li { display: grid; grid-template-columns: 24px 1fr; gap: var(--s2); padding: var(--s2) 0; font-size: var(--t-sm); line-height: 1.55; border-top: 1px solid var(--line); }
.lessons li:first-of-type { border-top: 0; }
.lessons li::before { content: ""; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.lessons li.done { color: var(--faint); }
.lessons li.done::before { content: "✓"; display: grid; place-items: center; border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); font: 700 10px/1 var(--f-head); }
.lessons li.now { color: var(--text); }
.lessons li.now::before { border: 5px solid var(--accent); }
.lessons .all { display: inline-block; margin-top: var(--s3); font-size: var(--t-sm); color: var(--muted); border-bottom: 1px solid var(--line-strong); }

/* ชุดแจกที่ทำค้าง */
.kits { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.kit { display: grid; grid-template-columns: 112px 1fr; gap: var(--s4); padding: var(--s3); align-items: center; transition: border-color .2s; }
.kit:hover { border-color: var(--line-strong); }
.kit img { width: 112px; aspect-ratio: 1200 / 630; object-fit: cover; object-position: top; border-radius: var(--r-in); }
.kit h3 { font-size: var(--t-sm); line-height: 1.5; }
.kit .kstep { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); font-size: 12px; color: var(--faint); }
.kit .kstep .bar { flex: 1; height: 4px; }

/* แนะนำสำหรับคุณ (ฟีดรวม) */
.feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.item { position: relative; display: flex; flex-direction: column; overflow: hidden; transition: border-color .2s, transform .2s; }
.item:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.item .thumb { position: relative; aspect-ratio: 1200 / 630; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.item .lbl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.item .type { font-size: 11px; line-height: 1; padding: 4px var(--s2); border-radius: 999px; color: var(--text); border: 1px solid var(--line-strong); white-space: nowrap; }
.item .type.course { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-family: var(--f-head); font-weight: 700; }
.art > .only-member { display: contents; }
.item .body { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4) var(--s4) var(--s5); flex: 1; }
.item h3 { font-size: var(--t-md); line-height: 1.5; }
.item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: var(--s2); font-size: 12px; color: var(--faint); }
.item.feature { border-color: var(--accent-line); }
.why { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 12px; line-height: 1.4; color: var(--accent-text); }
.why::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }

/* ปุ่มบันทึก */
.save { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgb(var(--bg-rgb) / .7); color: var(--muted); cursor: pointer; flex: none; transition: color .15s, border-color .15s; }
.save:hover { color: var(--text); }
.save svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.save[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent-line); }
.save[aria-pressed="true"] svg { fill: var(--accent); }
.item .save { position: absolute; right: var(--s3); top: var(--s3); z-index: 1; }

/* ที่บันทึกไว้ */
.saved { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s6); padding: var(--s2) var(--s5); }
.saved li { display: grid; grid-template-columns: 80px 1fr auto; gap: var(--s4); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.saved li:nth-child(-n+2) { border-top: 0; }
.saved img { width: 80px; aspect-ratio: 1200 / 630; object-fit: cover; object-position: top; border-radius: 8px; }
.saved b { display: block; font: 700 var(--t-sm)/1.5 var(--f-head); }
.saved small { font-size: 12px; color: var(--faint); }

/* แนะนำคอร์ส (คนยังไม่ซื้อ) */
.pitch { display: grid; grid-template-columns: 1fr 300px; gap: var(--s6); padding: var(--s6); border-color: var(--accent-line); position: relative; overflow: hidden; }
.pitch::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 260px at 85% 30%, rgba(255, 225, 26, .12), transparent 70%); pointer-events: none; }
.pitch > * { position: relative; }
.pitch .why { margin-bottom: var(--s3); font-size: var(--t-xs); padding: 6px var(--s3); border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); }
.pitch h3 { font-size: 28px; line-height: 1.35; }
.pitch p { margin-top: var(--s3); max-width: 34em; }
.pitch .pts { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); margin-top: var(--s4); font-size: var(--t-sm); }
.pitch .pts li::before { content: "✓ "; color: var(--accent-text); }
.pitch .acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s5); }
.pitch .price { font: 700 24px/1 var(--f-head); color: var(--text); }
.pitch .price s { font: 400 var(--t-sm)/1 var(--f-body); color: var(--faint); margin-left: var(--s2); }
.pitch .vis { position: relative; height: 280px; }
.pitch .vis .book { position: absolute; left: 0; top: 40px; width: 150px; transform: rotate(-7deg); border-radius: 3px 8px 8px 3px; box-shadow: 0 30px 60px -20px rgb(var(--shadow-rgb) / .18); }
.pitch .vis .phone { position: absolute; right: 8px; top: 0; width: 150px; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: 0 30px 60px -24px rgb(var(--shadow-rgb) / .18); }
.pitch .vis .phone img { width: 100%; height: 100%; object-fit: cover; }
.pitch.quiet { border-color: var(--line); }

/* สมาชิกใหม่ · เริ่มต้น */
.start { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); counter-reset: st; }
.start li { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); }
.start li::before { counter-increment: st; content: counter(st); display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-in); font: 700 var(--t-md)/1 var(--f-head); color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.start h3 { font-size: var(--t-lg); margin-top: var(--s2); }
.start p { font-size: var(--t-sm); }
.start .btn { margin-top: auto; align-self: flex-start; }
.start li > :last-child { margin-top: auto; }
.start .p-wrap { margin-top: var(--s3); }
.empty-box { display: flex; align-items: center; gap: var(--s5); padding: var(--s5) var(--s6); border: 1px dashed var(--line-strong); border-radius: var(--r); font-size: var(--t-sm); }
.empty-box .ico { width: 28px; height: 28px; color: var(--faint); flex: none; }
.empty-box b { display: block; font: 700 var(--t-md)/1.5 var(--f-head); }

/* =========================================================
   ต้อนรับครั้งแรก (onboarding)
   ========================================================= */
.ob { min-height: 100vh; display: flex; flex-direction: column; position: relative; }
.ob::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(700px 420px at 50% -5%, rgba(255, 225, 26, .10), transparent 70%), radial-gradient(900px 600px at 0% 100%, rgba(80, 110, 200, .10), transparent 70%); }
.ob-head { position: relative; display: flex; align-items: center; justify-content: space-between; height: 68px; }
.ob-skip { background: none; border: 0; color: var(--muted); font-size: var(--t-sm); cursor: pointer; border-bottom: 1px solid var(--line-strong); padding: 0; }
.ob-main { position: relative; flex: 1; display: grid; place-items: start center; padding: var(--s6) 0 var(--s8); }
.ob-card { width: 100%; max-width: 680px; margin: 0 auto; padding: var(--s7); }
.ob-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.pdots { display: flex; gap: var(--s2); }
.pdots i { width: 28px; height: 6px; border-radius: 999px; background: rgb(var(--ink-rgb) / .12); }
.pdots i.on { background: var(--accent); }
.ob-count { font-size: var(--t-xs); color: var(--faint); }
.ob h1 { font-size: 32px; line-height: 1.3; }
.ob .lede { margin-top: var(--s2); }
.privacy { display: flex; align-items: flex-start; gap: var(--s2); margin-top: var(--s3); font-size: var(--t-xs); color: var(--faint); }
.privacy .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent-text); }
.opts { display: grid; gap: var(--s3); margin-top: var(--s6); }
.opt { display: grid; grid-template-columns: 24px 1fr; gap: var(--s4); align-items: start; text-align: left; width: 100%; padding: var(--s4) var(--s5); border-radius: var(--r-in); border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.opt::before { content: ""; width: 20px; height: 20px; margin-top: 4px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.opt:hover { border-color: rgba(255, 255, 255, .3); }
.opt b { display: block; font: 700 var(--t-md)/1.5 var(--f-head); }
.opt span { display: block; font-size: var(--t-sm); color: var(--muted); line-height: 1.6; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: linear-gradient(90deg, rgba(255, 225, 26, .08), transparent 70%), var(--surface-2); }
.opt[aria-pressed="true"]::before { border: 6px solid var(--accent); }
.opts.two { grid-template-columns: 1fr 1fr; }
.pick { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s6); }
.pick button { display: inline-flex; align-items: center; gap: var(--s2); height: 44px; padding: 0 var(--s4); border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer; font-size: var(--t-sm); transition: all .15s; }
.pick button::before { content: "+"; color: var(--faint); font-size: 16px; line-height: 1; }
.pick button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.pick button[aria-pressed="true"]::before { content: "✓"; color: var(--accent-text); font-family: var(--f-head); font-size: 13px; }
.pick-note { margin-top: var(--s3); font-size: var(--t-xs); color: var(--faint); }
.field { display: grid; gap: var(--s2); margin-top: var(--s5); }
.field > span { font-size: var(--t-sm); color: var(--text); }
.field small { font-size: var(--t-xs); color: var(--faint); }
.input { width: 100%; height: 48px; padding: 0 var(--s4); border-radius: var(--r-in); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: var(--t-sm); }
.input::placeholder { color: var(--faint); }
.input[readonly] { color: var(--muted); background: transparent; }
textarea.input { height: 96px; padding: var(--s3) var(--s4); line-height: 1.6; resize: vertical; }
select.input { appearance: none; padding-right: 40px; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239ba4b6' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center; }
.ob-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line); }
.ob-foot .later { font-size: var(--t-sm); color: var(--faint); }
.ob-foot .r { display: flex; gap: var(--s3); margin-left: auto; }

/* =========================================================
   บัญชี (การซื้อ / ตั้งค่า)
   ========================================================= */
.m-acct { display: grid; grid-template-columns: 240px 1fr; gap: var(--s7); align-items: start; }
.side-nav { position: sticky; top: 92px; display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-in); font-size: var(--t-sm); color: var(--muted); }
.side-nav a:hover { color: var(--text); background: rgb(var(--ink-rgb) / .03); }
.side-nav a[aria-current="page"] { color: var(--text); background: var(--surface); border: 1px solid var(--line); }
.side-nav a .ico { width: 18px; height: 18px; }
.side-nav a[aria-current="page"] .ico { color: var(--accent-text); }
.side-nav hr { border: 0; border-top: 1px solid var(--line); margin: var(--s3) 0; }
.side-nav .out { color: var(--faint); }
.panel { padding: var(--s6); }
.panel + .panel { margin-top: var(--s5); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.panel-head h2 { font-size: 22px; }
.panel-head p { font-size: var(--t-sm); margin-top: var(--s1); }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 var(--s3); border-radius: 999px; font-size: 12px; line-height: 1; white-space: nowrap; border: 1px solid var(--line-strong); color: var(--muted); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.on { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.tag.wait { color: var(--text); border-color: var(--accent-line); border-style: dashed; }
.tag.wait::before { background: var(--accent); }
.tag.off { color: var(--faint); }

.order { display: grid; grid-template-columns: 120px 1fr; gap: var(--s6); }
.order .cv { width: 120px; border-radius: 3px 8px 8px 3px; box-shadow: var(--shadow); transform: rotate(-3deg); }
.order h3 { font-size: 24px; line-height: 1.35; margin-top: var(--s3); }
.kv { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: var(--s2) var(--s7); margin-top: var(--s4); font-size: var(--t-sm); }
.kv dt { font-size: var(--t-xs); color: var(--faint); }
.kv dd { margin: 0; color: var(--text); }
.kv div { display: grid; gap: 2px; }
.order .acts { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.files { margin-top: var(--s6); border-top: 1px solid var(--line); }
.files li { display: grid; grid-template-columns: 40px 1fr auto; gap: var(--s4); align-items: center; padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.files .fi { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-in); background: var(--surface-2); border: 1px solid var(--line); font: 700 11px/1 var(--f-head); color: var(--accent-text); }
.files b { display: block; font: 700 var(--t-sm)/1.5 var(--f-head); }
.files small { font-size: 12px; color: var(--faint); }
.rcpt { margin-top: var(--s5); border: 1px solid var(--line); border-radius: var(--r-in); }
.rcpt summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); font-size: var(--t-sm); color: var(--text); }
.rcpt summary::-webkit-details-marker { display: none; }
.rcpt summary::after { content: "+"; color: var(--muted); }
.rcpt[open] summary::after { content: "−"; color: var(--accent-text); }
.rcpt table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.rcpt td { padding: var(--s2) var(--s4); border-top: 1px solid var(--line); }
.rcpt td + td { text-align: right; color: var(--text); }
.rcpt .tot td { font-family: var(--f-head); font-weight: 700; color: var(--text); }
.helpline { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); font-size: var(--t-sm); }

.prof { display: grid; grid-template-columns: auto 1fr; gap: var(--s5); align-items: center; }
.prof small { display: block; font-size: var(--t-xs); color: var(--faint); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s5); }
.form-grid .field { margin-top: var(--s5); }
.form-act { display: flex; align-items: center; gap: var(--s4); margin-top: var(--s5); font-size: var(--t-xs); color: var(--faint); }
.tgl-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s5); align-items: center; padding: var(--s4) 0; border-top: 1px solid var(--line); }
.tgl-row:first-of-type { border-top: 0; padding-top: 0; }
.tgl-row b { display: block; font: 700 var(--t-md)/1.5 var(--f-head); }
.tgl-row p { font-size: var(--t-sm); }
.tgl { position: relative; width: 48px; height: 28px; border-radius: 999px; background: rgb(var(--ink-rgb) / .12); border: 1px solid var(--line-strong); cursor: pointer; flex: none; padding: 0; }
.tgl::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.tgl[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.tgl[aria-checked="true"]::after { transform: translateX(20px); background: var(--accent-ink); }
.tgl:disabled { opacity: .5; cursor: not-allowed; }
.data-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-top: var(--s2); }
.data-list li { padding: var(--s3) var(--s4); border-radius: var(--r-in); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--t-sm); }
.data-list b { display: block; font: 700 var(--t-sm)/1.5 var(--f-head); }
.data-list small { font-size: 12px; color: var(--faint); line-height: 1.5; display: block; }
.not-kept { margin-top: var(--s4); font-size: var(--t-sm); }
.danger { border-style: dashed; box-shadow: none; background: transparent; }
.danger ul { margin-top: var(--s3); font-size: var(--t-sm); display: grid; gap: var(--s1); }
.danger li::before { content: "· "; color: var(--faint); }

/* =========================================================
   3 · แอดมิน CRM
   ========================================================= */
.adm .site-head .wrap, .adm .wrap { max-width: 1440px; }
.adm-badge { font: 400 12px/1 var(--f-body); color: var(--accent-text); border: 1px solid var(--accent-line); border-radius: 999px; padding: 4px 8px; margin-left: var(--s2); }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s3); }
.kpis li { padding: var(--s4); }
.kpis b { display: block; font: 700 26px/1.2 var(--f-head); }
.kpis span { font-size: var(--t-xs); color: var(--faint); }
.kpis small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpis .hot { border-color: var(--accent-line); }
.kpis .hot b { color: var(--accent-text); }
.crm > * { min-width: 0; }
.crm { display: grid; grid-template-columns: 1fr 420px; gap: var(--s5); align-items: start; margin-top: var(--s5); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s4); border-bottom: 1px solid var(--line); }
.toolbar .search { width: 280px; height: 40px; }
.toolbar select.input { width: auto; height: 40px; font-size: var(--t-xs); padding-left: var(--s3); }
.toolbar .sp { margin-left: auto; }
.segs { display: flex; gap: var(--s1); padding: var(--s3) var(--s4) 0; }
.segs button { height: 34px; padding: 0 var(--s3); border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-size: var(--t-xs); cursor: pointer; }
.segs button[aria-pressed="true"] { background: rgb(var(--ink-rgb) / .08); color: var(--text); }
.segs .n { margin-left: 4px; color: var(--faint); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-xs); }
.tbl th { text-align: left; font-weight: 400; color: var(--faint); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.row { cursor: pointer; transition: background .15s; }
.tbl tr.row:hover { background: rgba(255, 255, 255, .025); }
.tbl tr.row[aria-selected="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.who-cell { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.who-cell .avatar { width: 32px; height: 32px; font-size: 13px; }
.who-cell b { display: block; font: 700 var(--t-sm)/1.4 var(--f-head); white-space: nowrap; }
.who-cell small { display: block; font-size: 12px; color: var(--faint); white-space: nowrap; }
.tbl .mini { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.tbl .mini .bar { width: 56px; height: 4px; }
.tbl .ints { display: flex; gap: 4px; }
.tbl .ints .chip { height: 22px; font-size: 11px; }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; padding: var(--s3) var(--s4); font-size: var(--t-xs); color: var(--faint); }
.pager { display: flex; gap: var(--s1); }
.pager button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.pager button[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.mlist { display: none; }

.cust { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
.cust-head { padding: var(--s5); border-bottom: 1px solid var(--line); }
.cust-head .top { display: flex; align-items: center; gap: var(--s4); }
.cust-head h2 { font-size: 22px; }
.cust-head small { display: block; font-size: var(--t-xs); color: var(--faint); }
.cust-head .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s4); }
.cust-close { display: none; margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.facts-mini { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s4); margin-top: var(--s4); font-size: var(--t-xs); }
.facts-mini dt { color: var(--faint); }
.facts-mini dd { margin: 0; color: var(--text); }
.facts-mini div { display: grid; gap: 1px; }
.cust-sec { padding: var(--s5); border-bottom: 1px solid var(--line); }
.cust-sec h3 { font: 400 var(--t-xs)/1 var(--f-body); letter-spacing: .08em; color: var(--faint); margin-bottom: var(--s4); }
.grant { margin: var(--s4); padding: var(--s4); border-radius: var(--r-in); border: 1px solid var(--accent-line); background: linear-gradient(160deg, rgba(255, 225, 26, .08), transparent 60%), var(--surface-2); }
.grant h3 { font: 700 var(--t-md)/1.4 var(--f-head); color: var(--text); letter-spacing: 0; margin-bottom: var(--s1); }
.grant p { font-size: var(--t-xs); }
.grant .field { margin-top: var(--s3); }
.grant .field > span { font-size: var(--t-xs); }
.grant .input { height: 40px; font-size: var(--t-xs); }
.grant textarea.input { height: 72px; }
.grant .newsbox { margin-top: var(--s3); }
.grant .btn { margin-top: var(--s4); height: 48px; }
.signal { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3); margin-top: var(--s3); border-radius: var(--r-in); background: var(--surface-2); font-size: var(--t-xs); line-height: 1.6; }
.signal::before { content: "!"; flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 11px/1 var(--f-head); margin-top: 1px; }
.tl li { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: var(--s3); padding-bottom: var(--s4); font-size: var(--t-xs); line-height: 1.6; }
.tl li::before { content: ""; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line-strong); }
.tl li::after { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl li.k::before { border-color: var(--accent); }
.tl b { display: block; font-size: var(--t-sm); }
.tl small { color: var(--faint); }
.mprog li { display: grid; grid-template-columns: 1fr 64px 40px; gap: var(--s3); align-items: center; padding: 6px 0; font-size: var(--t-xs); }
.mprog li span:last-child { text-align: right; color: var(--faint); }
.mprog .bar { height: 4px; }
.notes li { padding: var(--s3); border-radius: var(--r-in); background: var(--surface-2); font-size: var(--t-xs); line-height: 1.6; }
.notes li + li { margin-top: var(--s2); }
.notes small { display: block; color: var(--faint); margin-top: 2px; }
.note-add { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); margin-top: var(--s3); }
.note-add .input { height: 40px; font-size: var(--t-xs); }
.note-add .btn { height: 40px; }
.pdpa-line { padding: var(--s4) var(--s5); font-size: 12px; color: var(--faint); }

/* =========================================================
   4 · จอเล็ก
   ========================================================= */
@media (max-width: 1080px) {
  .course-card { grid-template-columns: 120px 1fr; }
  .course-card .cover { width: 120px; }
  .lessons { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: var(--s5); }
  .kits, .feed, .arts { grid-template-columns: repeat(2, 1fr); }
  .crm { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .cust { position: fixed; inset: 0 0 0 auto; width: min(440px, 100%); max-height: none; top: 0; z-index: 40; border-radius: 0; transform: translateX(105%); transition: transform .25s; }
  .cust.open { transform: none; }
  .cust-close { display: grid; place-items: center; }
  .tbl .c-src, .tbl .c-int { display: none; }
}
@media (max-width: 760px) {
  :root { --t-h1: 34px; --t-h2: 28px; --t-lg: 18px; --t-page: 28px; }
  body { font-size: 16px; }
  .wrap { padding: 0 var(--s4); }
  .site-head .wrap { height: 60px; gap: var(--s3); }
  .nav { display: none; }
  .head-act { margin-left: auto; }
  .hide-m { display: none !important; }
  .me-btn { padding: 0; border: 0; }
  .me-btn .lbl { display: none; }
  
  /* แถบแท็บล่าง */
  .has-tabbar { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgb(var(--bg-rgb) / .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line-strong);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; line-height: 1.2; color: var(--faint); }
  .tabbar a[aria-current="page"] { color: var(--accent-text); }
  .tabbar svg { width: 22px; height: 22px; }

  .page { padding-top: var(--s5); }
  .page-head { flex-direction: column; align-items: stretch; gap: var(--s4); margin-bottom: var(--s5); }
  .sub { padding-top: var(--s7); }
  .sub-head h2 { font-size: 20px; }
  .sub-head { flex-wrap: wrap; gap: var(--s1) var(--s4); }
  .sub-head p { flex-basis: 100%; order: 3; }

  .hello { flex-direction: column; align-items: stretch; gap: var(--s4); padding-bottom: var(--s5); }
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); }
  .stats li { min-width: 0; padding: var(--s3); }
  .stats b { font-size: 20px; }
  .stats span { font-size: 12px; line-height: 1.4; display: block; }

  .course-card { grid-template-columns: 1fr; gap: var(--s4); padding: var(--s5); }
  .course-card .cover { width: 84px; position: absolute; right: var(--s5); top: var(--s5); margin: 0; }
  .course-card .info { padding-right: 100px; }
  .course-card h3 { font-size: 21px; }
  .course-card .next, .course-card .acts, .course-card .prog-row { margin-right: -100px; }
  .course-card .acts .btn { flex: 1 1 100%; }
  .lessons { padding-top: var(--s4); }

  .kits { grid-template-columns: 1fr; gap: var(--s3); }
  .kit { grid-template-columns: 96px 1fr; }
  .kit img { width: 96px; }
  .feed, .arts { grid-template-columns: 1fr; gap: var(--s3); }
  .item, .art { display: grid; grid-template-columns: 120px 1fr; gap: var(--s3); padding: var(--s3); align-items: start; }
  .item .thumb, .art .thumb { border: 0; border-radius: var(--r-in); }
  .item .lbl { padding-right: 36px; gap: 4px 8px; }
  .item .body, .art .body { padding: 0; gap: var(--s1); }
  .item h3, .art h3 { font-size: var(--t-sm); padding-right: 32px; }
  .item .save, .art .save { width: 32px; height: 32px; right: var(--s3); top: var(--s3); }
  .item .meta { padding-top: var(--s1); }
  .item .meta .chip { height: 22px; font-size: 11px; }
  .art p { display: none; }
  .art .meta { border-top: 0; padding-top: var(--s1); justify-content: flex-start; flex-wrap: wrap; gap: var(--s1) var(--s3); }
  .why { font-size: 11px; }

  .saved { grid-template-columns: 1fr; padding: var(--s1) var(--s4); }
  .saved li:nth-child(2) { border-top: 1px solid var(--line); }
  .saved li { grid-template-columns: 72px 1fr auto; gap: var(--s3); }
  .saved img { width: 72px; }

  .pitch { grid-template-columns: 1fr; padding: var(--s5); gap: var(--s4); }
  .pitch .vis { order: -1; height: 190px; }
  .pitch .vis .book { width: 108px; top: 30px; left: 16px; }
  .pitch .vis .phone { width: 104px; right: 24px; border-radius: 14px; }
  .pitch h3 { font-size: 22px; }
  .pitch .acts .btn { flex: 1 1 100%; }
  .start { grid-template-columns: 1fr; gap: var(--s3); }
  .start li { padding: var(--s4); display: grid; grid-template-columns: 36px 1fr; gap: 0 var(--s3); }
  .start li > * { grid-column: 2; }
  .start li::before { grid-row: 1 / span 4; }
  .start h3 { margin-top: 4px; }
  .start .btn { margin-top: var(--s3); }
  .empty-box { padding: var(--s4); gap: var(--s3); align-items: flex-start; }

  .ob-card { padding: var(--s5); border-radius: var(--r); }
  .ob-main { padding-top: var(--s2); }
  .ob h1 { font-size: 25px; }
  .opts.two { grid-template-columns: 1fr; }
  .opt { padding: var(--s3) var(--s4); gap: var(--s3); }
  .ob-foot { position: sticky; bottom: 0; margin: var(--s6) calc(var(--s5) * -1) calc(var(--s5) * -1); padding: var(--s4) var(--s5); background: var(--surface); border-radius: 0 0 var(--r) var(--r); }
  .ob-foot .later { display: none; }
  .ob-foot .r { flex: 1; }
  .ob-foot .r .btn { padding: 0 var(--s4); }
  .ob-foot .r .btn:last-child { flex: 1; }
  .ob-main > .wrap { min-width: 0; width: 100%; }

  .m-acct { grid-template-columns: 1fr; gap: var(--s4); }
  .side-nav { position: static; display: flex; overflow-x: auto; gap: var(--s2); margin: 0 calc(var(--s4) * -1); padding: 0 var(--s4); scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { flex: none; padding: var(--s2) var(--s4); border: 1px solid var(--line); border-radius: 999px; }
  .side-nav a .ico, .side-nav hr { display: none; }
  .panel { padding: var(--s5) var(--s4); }
  .panel-head { flex-direction: column; gap: var(--s3); }
  .order { grid-template-columns: 1fr; gap: var(--s4); }
  .order .cv { width: 88px; }
  .kv { grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s4); }
  .order .acts .btn { flex: 1 1 100%; }
  .files li { grid-template-columns: 40px 1fr; }
  .files li .btn { grid-column: 1 / -1; }
  .helpline { flex-direction: column; align-items: stretch; }
  .form-grid { grid-template-columns: 1fr; }
  .data-list { grid-template-columns: 1fr; }
  .form-act { flex-direction: column; align-items: stretch; }
  .form-act .btn { width: 100%; }

  .kpis { grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
  .kpis li:last-child { grid-column: 1 / -1; }
  .kpis b { font-size: 22px; }
  .toolbar .search { width: 100%; }
  .toolbar select.input { flex: 1 1 45%; }
  .toolbar .sp { margin-left: 0; flex: 1 1 100%; }
  .segs { overflow-x: auto; scrollbar-width: none; }
  .segs button { flex: none; }
  .tbl { display: none; }
  .mlist { display: block; }
  .mlist li { display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s3); padding: var(--s4); border-bottom: 1px solid var(--line); cursor: pointer; }
  .mlist li[aria-selected="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
  .mlist .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); font-size: 12px; color: var(--faint); }
  .tbl-foot { flex-direction: column; gap: var(--s3); }
  .cust { width: 100%; }
}
.start p .ico { width: 16px; height: 16px; vertical-align: -3px; color: var(--accent-text); }
.field .pick { margin-top: var(--s1); }

/* ---------- เพิ่มเติมจากของจริง ---------- */
.w0 { width: 0; }
.lessons li a:hover { color: var(--text); }
.kit .kstep .done-tag { color: var(--accent-text); }
.done-tag { color: var(--accent-text); }
.order-wrap + .order-wrap { margin-top: var(--s6); padding-top: var(--s6); border-top: 1px solid var(--line); }
.tag.rev { color: var(--danger); border-color: rgba(255, 122, 110, .45); }
.empty-row { padding: var(--s6) var(--s4); text-align: center; color: var(--faint); font-size: var(--t-sm); }
.funnel { display: grid; grid-template-columns: repeat(9, 1fr); gap: var(--s2); margin-top: var(--s3); padding: var(--s4); }
.funnel li { padding: var(--s2) var(--s3); border-left: 1px solid var(--line); }
.funnel li:first-child { border-left: 0; }
.funnel b { display: block; font: 700 22px/1.2 var(--f-head); }
.funnel span { font-size: 12px; color: var(--faint); line-height: 1.4; display: block; }
.funnel-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--s5); font-size: var(--t-xs); color: var(--faint); }
.funnel-head h2 { font-size: 18px; }
.adm-login { max-width: 420px; margin: var(--s8) auto; padding: var(--s6); }
.adm-login h1 { font-size: 26px; }
.adm-login p { margin-top: var(--s2); font-size: var(--t-sm); }
.adm-login .input { margin-top: var(--s4); }
.adm-login .btn { margin-top: var(--s3); }
.grant .msg { margin-top: var(--s3); font-size: var(--t-xs); color: var(--text); }
.grant .revoke { margin-top: var(--s2); width: 100%; height: 40px; }
.pager button:disabled { opacity: .4; cursor: default; }
.mprog .empty, .cust-sec .empty { font-size: var(--t-xs); color: var(--faint); }
.buys li { display: grid; gap: 2px; padding: var(--s2) 0; font-size: var(--t-xs); border-top: 1px solid var(--line); }
.buys li:first-child { border-top: 0; }
.buys b { font-size: var(--t-sm); }
.buys small { color: var(--faint); }
.ob-skip { color: var(--muted); }
.save:disabled { opacity: .5; }
@media (max-width: 1080px) {
  .funnel { grid-template-columns: repeat(4, 1fr); }
  .funnel li:nth-child(n+5) { border-top: 1px solid var(--line); padding-top: var(--s3); }
  .funnel li:nth-child(4n+1) { border-left: 0; }
}
@media (max-width: 760px) {
  .mem .site-head .wrap { height: 60px; gap: var(--s3); }
  .mem .site-foot { margin-top: var(--s8); }
  .mem .site-foot .wrap { grid-template-columns: 1fr 1fr; }
  .mem .site-foot .about { grid-column: 1 / -1; }
  .funnel { grid-template-columns: repeat(2, 1fr); }
  .funnel li:nth-child(odd) { border-left: 0; }
  .m-guest { padding: var(--s6) var(--s4); margin-top: var(--s6); }
}
/* ฟอร์มแอดมิน (ยกจากต้นแบบ) */
.btn.block { width: 100%; }
.newsbox { display: flex; gap: var(--s2); align-items: flex-start; margin-top: var(--s4); font-size: var(--t-xs); line-height: 1.6; color: var(--muted); cursor: pointer; }
.newsbox input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.form-grid .field, .field { align-content: start; }
.pitches { display: grid; gap: var(--s5); }

/* เหรียญจบคอร์สฝึก (ผ่านสอบรวม) · แดชบอร์ด /me */
.badges { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s4) 0 0; }
.badge-card { display: flex; align-items: center; gap: var(--s3); padding: 12px 16px 12px 12px; border-radius: var(--r); background: linear-gradient(120deg, rgba(255, 225, 26, .1), transparent 70%), var(--surface); border: 1px solid var(--accent-line); text-decoration: none; color: var(--text); }
.badge-card .bd-mark { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 3px #0a0e17, 0 0 0 2px var(--accent); position: relative; }
.badge-card .bd-mark::after { content: ""; position: absolute; left: 13px; top: 10px; width: 10px; height: 16px; border: solid #0a0e17; border-width: 0 4px 4px 0; transform: rotate(45deg); }
.badge-card b { display: block; font: 700 15.5px/1.35 var(--font-head); }
.badge-card small { font-size: 13px; color: var(--muted); }
