/* =====================================================================
   ADSPRO v2 — สไตล์หลัก
   ค่าทั้งหมดถอดตรงจากไฟล์ดีไซน์ "ADSPRO SMM Panel.dc.html" (บรรทัด 41–332)
   สีทุกจุดอ้างอิงจาก tokens.css เท่านั้น
   ===================================================================== */

/* ---------- พื้นฐาน ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* แถบเมนูลอยอยู่สูง 60px + ระยะห่างขอบบน — ถ้าไม่กันระยะไว้
   การกดลิงก์ #picked หรือการ Tab ไปยัง element ที่อยู่นอกจอ จะเลื่อนมาแล้วโดนแถบเมนูบังพอดี */
html {
  scroll-padding-top: 88px;
  /* ต้องใส่ที่ <html> ด้วย ไม่ใช่แค่ body — เบราว์เซอร์ไม่ได้ส่งต่อค่า clip ของ body
     ขึ้นไปให้ viewport เหมือนที่ทำกับ hidden ผลคือหน้า panel (ที่ไม่มี .page ห่อ)
     ยังเลื่อนซ้ายขวาได้จากตารางกว้าง 840px */
  overflow-x: clip;
}
@supports not (overflow: clip) {
  html { overflow-x: hidden; }
}
@media (max-width: 900px) { html { scroll-padding-top: 82px; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-th);
  /* ต้นฉบับไม่ตั้ง font-size/line-height ที่ body (ใช้ค่า default 16px / normal)
     แล้วกำหนด line-height เฉพาะจุดที่ต้องการ — ถ้าตั้ง 1.6 ทั้งหน้า ทุกแถวจะสูงขึ้น
     สะสมกันจนหน้ายาวกว่าต้นฉบับหลายร้อย px */
  font-size: 16px;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  /* ต้องเป็น clip ไม่ใช่ hidden — overflow:hidden ทำให้ element กลายเป็น scroll container
     แล้ว position:sticky ของแถบเมนูจะไม่ทำงาน ส่วน clip กันล้นได้เหมือนกันแต่ไม่สร้าง scroll container */
  overflow-x: clip;
}
@supports not (overflow: clip) {
  body { overflow-x: hidden; }   /* Safari < 16: ยอมเสีย sticky ดีกว่าปล่อยให้เลื่อนซ้ายขวาได้ */
}
body, body * {
  transition: background-color .22s ease, border-color .22s ease, color .22s ease, box-shadow .22s ease;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { text-wrap: balance; }

::selection { background: var(--accsoft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* ลิงก์ "ข้ามไปยังเนื้อหาหลัก" ต้องโผล่ให้เห็นตอนถูกโฟกัส ไม่งั้นซ่อนถาวรก็ไร้ประโยชน์
   (WCAG 2.4.1 Bypass Blocks — ผู้ใช้คีย์บอร์ดต้องเห็นว่ากำลังจะกดอะไร) */
.skip-link:focus {
  position: fixed; left: 16px; top: 16px; z-index: 200;
  width: auto; height: auto; margin: 0; overflow: visible; clip: auto;
  padding: 12px 20px; border-radius: 12px;
  background: var(--card); color: var(--text); border: 2px solid var(--accent);
  box-shadow: var(--shadow); font-size: 14px; font-weight: 600;
}
.num { font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; }
.mut { color: var(--mut); }

/* กรอบเนื้อหา — ตรงกับดีไซน์: max-width 1240, padding 22px 32px 0
   เบราว์เซอร์ที่ไม่รู้จัก overflow:clip (Safari < 16 / iOS 15) จะตกไปใช้ hidden
   ซึ่งทำให้ .page กลายเป็น scroll container แล้วแถบเมนู sticky ตายสนิท
   จึงต้องใส่ hidden เฉพาะตอนที่ clip ใช้ไม่ได้จริง ๆ เท่านั้น */
.page { position: relative; min-height: 100vh; overflow: clip; }
@supports not (overflow: clip) {
  .page { overflow: hidden; }
}
.wrap { position: relative; max-width: 1240px; margin: 0 auto; padding: 22px 32px 0; }

/* แสงพื้นหลังของทั้งหน้า */
.page-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 420px at 50% -80px, var(--accsoft), transparent 70%),
    radial-gradient(700px 500px at 88% 30%, var(--accsoft), transparent 65%);
}

/* =====================================================================
   NAV
   ===================================================================== */
/* แถบเมนูลอยตามการเลื่อนหน้า
   ต้องมีตัวห่อแยกต่างหาก เพราะเมนูมือถือ (.nav-mobile) ต้องเลื่อนติดไปด้วย
   ถ้าใส่ sticky ที่ .nav เฉย ๆ เมนูที่กางออกจะค้างอยู่ที่เดิมแล้วหลุดจากปุ่ม */
.nav-dock { position: sticky; top: 10px; z-index: 90; }
.nav-dock .nav { transition: box-shadow .25s ease, border-color .25s ease, background-color .22s ease; }
/* พอเริ่มเลื่อน ให้ยกแถบขึ้นมาด้วยเงาที่เข้มขึ้น จะได้แยกออกจากเนื้อหาที่วิ่งผ่านข้างหลัง */
.nav-dock.is-stuck .nav {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: 0 12px 34px rgba(20, 22, 50, .18), var(--glow);
}
:root[data-theme="dark"] .nav-dock.is-stuck .nav {
  box-shadow: 0 12px 34px rgba(0, 0, 0, .55), var(--glow);
}

.nav {
  display: flex; align-items: center; gap: 24px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 12px 10px 20px; box-shadow: var(--shadow);
}
.nav-brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.nav-logo {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-num); font-weight: 700; font-size: 17px; box-shadow: var(--glow);
}
/* มีโลโก้จริง — ถอดพื้นไล่สี/เงา ให้รูปเต็มความสูง ความกว้างยืดเองได้ (รองรับโลโก้แนวนอน/จัตุรัส) */
.nav-logo.has-img { width: auto; min-width: 34px; max-width: 150px; border-radius: 8px;
  background: none; box-shadow: none; padding: 0; overflow: hidden; }
.nav-logo.has-img img { height: 34px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.nav-title { font-family: var(--font-num); font-weight: 700; font-size: 16px; letter-spacing: .04em; }
.nav-tag { font-size: 10px; color: var(--mut); letter-spacing: .18em; margin-top: -2px; }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  border: 0; background: transparent; color: var(--mut);
  padding: 9px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
}
.nav-link:hover { color: var(--text); background: var(--chipbg); }
.nav-link.is-active { background: var(--accsoft); color: var(--accent-ink); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 999px; flex: none;
  border: 1px solid var(--line); background: var(--chipbg); color: var(--text);
  display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--accent); }
.nav-burger { display: none; }
/* ธีมสว่าง = โชว์พระจันทร์ (กดเพื่อไปมืด), ธีมมืด = โชว์ดวงอาทิตย์ — คุมด้วย CSS ล้วน ไม่รอ JS */
.theme-btn [data-icon="sun"] { display: none; }
.theme-btn [data-icon="moon"] { display: block; }
:root[data-theme="dark"] .theme-btn [data-icon="sun"] { display: block; }
:root[data-theme="dark"] .theme-btn [data-icon="moon"] { display: none; }

.btn-login {
  border: 1px solid var(--line); background: transparent; color: var(--text);
  padding: 9px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
}
.btn-login:hover { border-color: var(--accent); color: var(--text); }
.btn-register {
  border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  padding: 10px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600; box-shadow: var(--glow);
}
.btn-register:hover { filter: brightness(1.08); color: #fff; }

/* เมนูมือถือ — เป็นแผงลอยใต้แถบเมนู ต้องมีพื้นหลังทึบเพราะเนื้อหาวิ่งผ่านข้างหลังตอนเลื่อน */
.nav-mobile {
  display: none; margin-top: 10px; padding: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow);
}
/* .is-open ประกาศไว้ใน @media (max-width: 900px) เท่านั้น
   กันเคสเปิดเมนูบนมือถือแล้วขยายจอ — เมนูจะไม่ค้างโผล่บนเดสก์ท็อป */
.nav-mobile a { display: block; padding: 11px 14px; border-radius: 12px; color: var(--text); font-size: 14px; }
.nav-mobile a:hover { background: var(--chipbg); }
.nav-mobile .is-active { background: var(--accsoft); color: var(--accent-ink); font-weight: 600; }
.nav-mobile .nav-mobile-cta {
  margin-top: 6px; text-align: center; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
}
.nav-mobile .nav-mobile-cta:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }

/* =====================================================================
   HERO
   ===================================================================== */
.hero { position: relative; text-align: center; padding: 84px 0 40px; }

.hero-blur {
  position: absolute; left: 50%; top: 210px; width: 560px; height: 280px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--accsoft), transparent);
  filter: blur(34px); pointer-events: none;
}
.hero-ring {
  position: absolute; left: 50%; top: 230px; transform: translate(-50%, -50%);
  border: 1.5px dashed var(--line); border-radius: 999px; pointer-events: none;
}
.hero-ring.r1 { width: 640px; height: 640px; opacity: .55; }
.hero-ring.r2 { width: 880px; height: 880px; opacity: .35; }
.hero-dot { position: absolute; border-radius: 99px; box-shadow: var(--glow); pointer-events: none; }

/* ไอคอนแพลตฟอร์มลอยรอบ hero */
.hero-icon {
  position: absolute; border-radius: 99px; background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; animation: floaty 7s ease-in-out infinite;
}
/* การ์ดสถิติลอย */
.hero-card {
  position: absolute; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow);
  text-align: left; animation: floaty 7s ease-in-out infinite;
}
.hero-decor { display: block; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px 6px 7px; margin-bottom: 26px; position: relative;
}
.hero-badge .tag {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.hero-badge .txt { font-size: 12.5px; color: var(--mut); }

.hero h1 {
  position: relative;
  font-size: 56px; line-height: 1.15; font-weight: 700;
  margin: 0 auto; max-width: 860px; letter-spacing: -.01em;
}
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--info));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead {
  position: relative;
  font-size: 16.5px; color: var(--mut); max-width: 560px;
  margin: 20px auto 0; line-height: 1.75; text-wrap: pretty;
}
.hero-cta { position: relative; display: flex; gap: 12px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.btn-hero-primary {
  border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  padding: 15px 32px; border-radius: 14px; font-size: 15.5px; font-weight: 600; box-shadow: var(--glow);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-hero-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-hero-ghost {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 15px 28px; border-radius: 14px; font-size: 15.5px; font-weight: 600;
  display: inline-flex; align-items: center;
}
.btn-hero-ghost:hover { border-color: var(--accent); color: var(--text); }

.hero-chips { position: relative; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 44px; }
.hero-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: 12.5px; color: var(--mut);
}
.hero-chip i { color: var(--accent-ink); font-style: normal; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-top: 12px; }
.bars span { display: block; width: 14%; background: var(--accsoft); border-radius: 3px; }

/* =====================================================================
   สไลด์ (การ์ดซ้อนกันแบบสำรับไพ่)
   ===================================================================== */
.slides { position: relative; height: 306px; margin: 38px 0 46px; }
.slide {
  position: absolute; left: 50%; top: 0;
  width: min(880px, 82%); height: 278px; border-radius: 22px; overflow: hidden;
  cursor: pointer; box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
  transition: transform .5s cubic-bezier(.22, .8, .3, 1), opacity .5s ease;
  border: 0; padding: 0; text-align: left; display: block; color: #fff;
  /* สถานะเริ่มต้นต้องอยู่ใน CSS ไม่ใช่รอ JS มาเซ็ต
     ถ้าไม่มีบรรทัดนี้ ระหว่างที่ยังโหลด app.js (defer) การ์ดทุกใบจะกองซ้อนกันเยื้องไปทางขวาครึ่งใบ
     เพราะ left:50% ทำงานแล้วแต่ยังไม่มี translateX(-50%) มาดึงกลับ */
  transform: translateX(-50%) scale(1);
  opacity: 0;
}
/* ใบแรกโชว์ทันทีตั้งแต่ HTML มาถึง JS จะมาเซ็ต inline style ทับให้เองทีหลัง */
.slide:first-of-type { opacity: 1; z-index: 20; }
.slide .c1 { position: absolute; right: -40px; top: -50px; width: 210px; height: 210px; border-radius: 99px; background: rgba(255,255,255,.13); }
.slide .c2 { position: absolute; right: 80px; bottom: -80px; width: 180px; height: 180px; border-radius: 99px; background: rgba(255,255,255,.08); }
.slide .art { position: absolute; right: 60px; top: 54px; opacity: .32; }
/* ภาพพื้นหลังสไลด์ (เมื่อกำหนด img) — วางใต้ทุกอย่าง ส่วน gradient เดิมของ .slide โผล่ตอนรูปโหลดไม่ขึ้น */
.slide-bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 0; }
/* ฉากมืดทับรูป ให้ตัวอักษรสีขาวอ่านออกทุกภาพ (ไล่จากซ้ายที่มีข้อความให้เข้มกว่า) */
.slide.has-img::after { content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(12,12,32,.74), rgba(12,12,32,.34) 58%, rgba(12,12,32,.12)); }
.slide.has-img .slide-inner { z-index: 2; }
/* มีภาพจริงแล้วไม่ต้องมีไอคอนลอย/วงกลมตกแต่งของสไลด์แบบไล่สี */
.slide.has-img .art, .slide.has-img .c1, .slide.has-img .c2 { display: none; }
/* ต้องเป็น block: ถ้าปล่อยเป็น inline (span) padding จะใช้ได้แค่บรรทัดแรก
   และ max-width จะไม่ทำงานเลย ทำให้ข้อความล้นออกนอกการ์ดทางซ้าย */
.slide-inner { display: block; position: relative; padding: 28px 44px; color: #fff; max-width: 68%; }
.slide-badge { display: inline-block; }
.slide-cta   { display: inline-block; }
/* กันข้อความยาวดันการ์ดจนล้น (คำอธิบายจากฐานข้อมูลยาวไม่เท่ากัน) */
.slide-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-sub   { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.slide-badge {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35);
  font-size: 11.5px; font-weight: 700; padding: 5px 13px; border-radius: 999px; letter-spacing: .05em;
}
.slide-title { font-size: 24px; font-weight: 700; line-height: 1.32; margin: 12px 0 8px; text-wrap: pretty; }
.slide-sub { font-size: 13.5px; opacity: .85; line-height: 1.65; text-wrap: pretty; }
.slide-cta {
  margin-top: 16px; border: 0; background: #fff; color: #1A1A2E;
  padding: 9px 19px; border-radius: 10px; font-size: 12.5px; font-weight: 700;
}
.slide-dots { position: absolute; left: 50%; transform: translateX(-50%); bottom: -26px; display: flex; gap: 7px; z-index: 30; }
/* จุดบอกสไลด์: หน้าตายังเป็นจุด 8px ตามดีไซน์ แต่พื้นที่กดจริงถูกขยายด้วย ::after เป็น 24x24
   (จุด 8px กดพลาดตลอดบนมือถือ และต่ำกว่าเกณฑ์ขั้นต่ำ WCAG 2.5.8 ที่ 24x24)
   ยอมรับว่าพื้นที่กดของจุดที่ติดกันเหลื่อมกันบ้าง แต่กดพลาดแค่เลื่อนสไลด์ผิดไปหนึ่งใบ */
.slide-dots button {
  position: relative; width: 8px; height: 8px; border-radius: 99px; border: 0;
  background: var(--line); transition: width .3s ease; padding: 0;
}
.slide-dots button::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max(100%, 24px); height: 24px;
}
.slide-dots button[aria-current="true"] { width: 26px; background: var(--accent); }
/* ปุ่มหยุด/เล่นสไลด์ (WCAG 2.2.2) — วางต่อท้ายจุด ขนาดพอให้นิ้วกดได้ */
.slide-dots .slide-play {
  width: auto; height: 24px; min-width: 24px; padding: 0 8px; margin-left: 6px;
  border-radius: 999px; background: var(--chipbg);
  color: var(--text);            /* --mut บน --chipbg ได้ 4.35:1 ไม่ผ่านเกณฑ์ 4.5:1 */
  font-size: 9px; line-height: 24px; letter-spacing: .05em;
}
.slide-dots .slide-play:hover { background: var(--accsoft); color: var(--accent-ink); }
.slide-dots .slide-play::after { content: none; }   /* ปุ่มนี้ใหญ่พอแล้ว ไม่ต้องขยายพื้นที่กด */

/* =====================================================================
   แพลตฟอร์มที่รองรับ
   ===================================================================== */
.pf-wrap { text-align: center; padding: 26px 0 10px; }
.pf-label { font-size: 12.5px; color: var(--mut); letter-spacing: .1em; margin-bottom: 18px; }
.pf-row { display: flex; justify-content: center; gap: 26px; flex-wrap: wrap; opacity: .75; }
.pf { display: flex; align-items: center; gap: 8px; color: var(--mut); font-weight: 600; font-size: 14.5px; }
/* ---------- คารูเซลแพลตฟอร์มวิ่งวน 2 แถว (infinite marquee) ---------- */
.pf-marquee { display: flex; flex-direction: column; gap: 14px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.pf-track { display: flex; width: max-content; will-change: transform;
  animation: pf-scroll 42s linear infinite; }
.pf-track.is-rev { animation-duration: 52s; animation-direction: reverse; }
/* ชุดไอเทม 1 ชุด — เว้นระยะท้ายชุดให้เท่าช่องไฟภายใน เพื่อรอยต่อเนียน */
.pf-set { display: flex; gap: 18px; padding-right: 18px; align-items: center; }
.pf-marquee .pf { border-radius: 12px;
  padding: 9px 16px; white-space: nowrap; color: var(--text); opacity: .9; }
.pf-marquee:hover .pf-track { animation-play-state: paused; }   /* ชี้ค้างไว้ = หยุดให้อ่าน */
@keyframes pf-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* เคารพผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหว — หยุดวิ่ง แล้วให้เลื่อนเองด้วยนิ้ว/เมาส์ */
@media (prefers-reduced-motion: reduce) {
  .pf-track { animation: none; }
  .pf-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .pf-set:nth-child(2) { display: none; }
}
/* ---------- การ์ดสายบริการแบบพิเศษ (เน้นให้เด่น) ---------- */
.cat.is-special { box-shadow: 0 14px 34px color-mix(in srgb, #F59E0B 34%, transparent); }
.cat.is-special::after { content: 'ฟรี'; position: absolute; top: 12px; right: 12px; z-index: 3;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.4); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; }
/* การ์ดที่มีภาพพื้นหลัง (อัปโหลดจากหลังบ้าน) — รูปทับพื้นธีมสี + ทาบฉากมืดให้ตัวอักษรอ่านออก */
.cat-bg { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; }
.cat.has-img::before { content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(160deg, rgba(8,8,22,.34), rgba(8,8,22,.78)); }
.cat.has-img .b1, .cat.has-img .b2 { display: none; }
.cat.has-img .ico { z-index: 2; opacity: .95; }
.cat.has-img .cat-foot { position: relative; z-index: 2; }

/* =====================================================================
   หัวข้อ section
   ===================================================================== */
.sec-head { padding: 70px 0 8px; text-align: center; }
.sec-head.tight { padding: 56px 0 4px; }
.sec-head h2 { font-size: 32px; font-weight: 700; margin: 0; }
.sec-head p { color: var(--mut); font-size: 14.5px; margin: 12px 0 0; }

/* =====================================================================
   การ์ดหมวดบริการ
   ===================================================================== */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 30px 0 8px; }
.cat {
  position: relative; height: 206px; border-radius: 18px; overflow: hidden;
  cursor: pointer; text-align: left; box-shadow: var(--shadow); display: block; color: #fff;
  transition: transform .2s ease;
}
.cat:hover { transform: translateY(-4px); color: #fff; }
.cat .b1 { position: absolute; right: -30px; top: -36px; width: 140px; height: 140px; border-radius: 99px; background: rgba(255,255,255,.14); }
.cat .b2 { position: absolute; left: -40px; bottom: -60px; width: 150px; height: 150px; border-radius: 99px; background: rgba(0,0,0,.14); }
.cat .ico { position: absolute; right: 14px; top: 14px; opacity: .6; }
.cat-foot {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 46px 17px 15px; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(10,10,24,.68));
}
.cat-name { font-weight: 700; font-size: 14.5px; }
.cat-desc { font-size: 11px; opacity: .82; line-height: 1.55; margin: 5px 0 9px; text-wrap: pretty; }
.cat-price {
  display: inline-block; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.32);
  font-size: 10.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
}

/* =====================================================================
   บริการยอดนิยม
   ===================================================================== */
/* การ์ดย่อขนาดลงเพื่อวาง 4 ใบต่อแถว × 3 แถว = 12 บริการ (สุ่มใหม่ทุกครั้งที่เปิดหน้า) */
.pop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 28px 0 0; }
.pop {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; text-align: left; transition: transform .18s ease, border-color .18s ease;
  display: flex; flex-direction: column;
}
.pop:hover { border-color: var(--accent); transform: translateY(-2px); }
.pop-top { display: flex; gap: 11px; margin-bottom: 12px; }
.pop-ico {
  position: relative; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
}
/* โลโก้จริงวางทับ SVG — contain ไม่ใช่ cover เพราะโลโก้เป็นสี่เหลี่ยมจัตุรัสพื้นโปร่งใส
   ถ้า cover จะโดนตัดขอบ ส่วนรูปที่โหลดไม่ขึ้นจะโปร่งใสเฉย ๆ แล้วเห็น SVG ข้างหลังแทน */
.pop-ico img {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 26px; height: 26px; object-fit: contain;
}
/* ชื่อบริการจริงยาวกว่าในดีไซน์มาก ต้องล็อกไว้ 2 บรรทัดเป๊ะ ๆ
   (min-height ทำให้ชื่อสั้น-ยาวดันราคาลงมาที่ระดับเดียวกันทุกใบ) */
.pop-name {
  font-size: 13px; font-weight: 700; line-height: 1.4; min-height: 2.8em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pop-grid > .pop { align-self: stretch; }
.pop-price-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.pop-price { font-family: var(--font-num); font-weight: 700; font-size: 14px; color: var(--accent-ink); }
.pop-price small { font-size: 10.5px; color: var(--mut); font-weight: 400; font-family: var(--font-th); }
.pop-meta {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; font-size: 11.5px; color: var(--mut);
  border-top: 1px solid var(--line); padding-top: 11px; margin: auto 0 13px;
}
.pop-meta div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pop-meta svg { flex: none; }
.pop-meta span.up { color: var(--good-ink); font-weight: 700; }
.pop-meta span.down { color: var(--warn-ink); font-weight: 700; }
.pop-buy {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  padding: 10px; border-radius: 11px; font-size: 12.5px; font-weight: 600; box-shadow: var(--glow);
}
.pop-buy:hover { filter: brightness(1.08); color: #fff; }
.more-wrap { text-align: center; margin-top: 20px; }
.btn-more {
  border: 1px solid var(--accent); background: transparent; color: var(--accent-ink);
  padding: 13px 36px; border-radius: 12px; font-size: 13.5px; font-weight: 600; display: inline-block;
}
.btn-more:hover { background: var(--accsoft); color: var(--accent-ink); }

/* =====================================================================
   กล่องรายการ (โปรแกรมออโต้ / ไลน์บอท)
   ===================================================================== */
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 56px 0 0; align-items: stretch; }
/* ปุ่ม "ดูทั้งหมด" ท้ายกล่อง — margin-top:auto ดันไปติดก้นกล่องเสมอ
   สองกล่องใน .duo จึงมีปุ่มอยู่ระดับเดียวกันแม้จำนวนรายการไม่เท่ากัน */
.more-link {
  margin-top: auto; padding-top: 14px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--accent-ink);
}
.more-link:hover { color: var(--accent); }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px;
  display: flex; flex-direction: column;   /* เพื่อให้ .more-link ดันไปติดก้นกล่องด้วย margin-top:auto */
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px; }
.panel-head h3 { margin: 0; font-size: 19px; font-weight: 700; }
.pill { font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.pill-warn { background: var(--warnsoft); color: var(--warn-ink); }
.pill-good { background: var(--goodsoft); color: var(--good-ink); }
.panel-sub { font-size: 12px; color: var(--mut); margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
/* รูปสินค้าจริง วางทับไอคอน SVG ที่อยู่ข้างหลัง
   ถ้ารูปโหลดไม่ขึ้น (บางรายการชี้ไปโฮสต์นอกที่ปิดไปแล้ว) img จะไม่กินพื้นที่เพราะ alt=""
   ไอคอนข้างหลังจะโผล่มาแทนเอง — ไม่ต้องพึ่ง onerror ใน JS */
.row-ico {
  position: relative; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
}
.row-ico.accent { background: var(--accsoft); color: var(--accent-ink); }
.row-ico.good { background: var(--goodsoft); color: var(--good-ink); }
/* ห้ามใส่ background ให้ img — ถ้ารูปโหลดไม่ขึ้น กล่องทึบจะบังไอคอนที่อยู่ข้างหลังพอดี
   ปล่อยให้โปร่งใส รูปเสียจะมองไม่เห็นและเห็นไอคอนแทน (JS จะถอด img ที่เสียออกอีกชั้น) */
.row-ico img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.row-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-price { font-family: var(--font-num); font-weight: 700; font-size: 13.5px; flex-shrink: 0; }
.row-price small { font-size: 10.5px; color: var(--mut); font-weight: 400; font-family: var(--font-th); }
.row-buy {
  border: 0; background: var(--accsoft); color: var(--accent-ink);
  padding: 7px 14px; border-radius: 9px; font-size: 11.5px; font-weight: 600; flex-shrink: 0;
}
.row-buy:hover { background: var(--accent); color: #fff; }

/* ---------- การ์ดไลน์บอท: แบนเนอร์เต็มความกว้าง ข้อมูลอยู่ใต้ภาพ ---------- */
/* 2 คอลัมน์ในกล่อง เพื่อให้ความสูงของสองกล่องใน .duo ไม่ต่างกันมากเกินไป
   (6 ใบเรียงเดี่ยวจะสูงกว่ากล่องโปรแกรมเกือบ 3 เท่า) */
/* 2 ใบต่อแถวในกล่องครึ่งจอ — 6 ใบพอดี 3 แถว และสูงใกล้เคียงกล่องโปรแกรมที่มี 10 รายการ */
.bot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 4px; }
.bot {
  background: var(--card2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .18s ease, transform .18s ease;
}
.bot:hover { border-color: var(--accent); transform: translateY(-2px); }
/* 3.6 = สัดส่วนจริงของแบนเนอร์ทุกใบ (1080x300) จองพื้นที่ไว้กัน CLS ตอนรูป lazy โหลดเสร็จ */
.bot-media { display: block; aspect-ratio: 3.6; background: var(--chipbg); overflow: hidden; }
.bot-media img { width: 100%; height: 100%; object-fit: cover; }
.bot-media-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--good-ink); }
.bot-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.bot-name {
  font-size: 12.5px; font-weight: 600; line-height: 1.4; min-height: 2.8em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bot-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bot-price { font-family: var(--font-num); font-weight: 700; font-size: 14px; white-space: nowrap; }
.bot-price small { font-size: 10px; color: var(--mut); font-weight: 400; font-family: var(--font-th); }
/* การ์ดโปรแกรมออโต้: โครงเดียวกับไลน์บอทแต่ภาพจัตุรัส 1:1 และคง 2 ใบต่อแถวทุกจอ
   (.is-square มี 2 คลาส specificity สูงกว่า .bot-grid เดี่ยว จึงชนะ media query ที่ปรับเป็น 1/3 คอลัมน์) */
.bot-grid.is-square { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bot-grid.is-square .bot-media { aspect-ratio: 1; }

/* =====================================================================
   เว็บไซต์สำเร็จรูป
   ===================================================================== */
.web-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 28px 0 0; }
.web {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 0;
  display: flex; flex-direction: column; text-align: left; overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.web:hover { border-color: var(--accent); transform: translateY(-2px); }

/* รูปหน้าปกของสคริปต์ — ล็อกสัดส่วน 16:9 ให้ทุกใบสูงเท่ากันไม่ว่ารูปต้นทางจะขนาดไหน */
.web-media {
  position: relative; display: block; flex: none;
  aspect-ratio: 16 / 9; background: var(--chipbg); overflow: hidden;
}
.web-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.web:hover .web-media img { transform: scale(1.04); }
/* ไล่เฉดมืดด้านบนไว้รอง badge — ภาพหน้าจอระบบส่วนใหญ่พื้นขาว ตัวหนังสือจะจมถ้าไม่มี */
.web-media::after {
  content: ''; position: absolute; inset: 0 0 55% 0;
  background: linear-gradient(180deg, rgba(8, 8, 20, .40), transparent);
}
.web-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
/* badge ลอยอยู่บนรูปถ่าย จึงใช้สีตายตัวที่ผ่านเกณฑ์คอนทราสต์ทั้งธีมสว่างและมืด
   ห้ามใช้ var(--accent)/var(--warn) ตรง ๆ เพราะสองค่านั้นเปลี่ยนตามธีม
   แล้วสีขาวบน --warn ได้คอนทราสต์แค่ 1.76:1 (เกณฑ์ WCAG AA ตัวอักษรเล็กคือ 4.5:1) */
.web-badge {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  font-size: 10.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
}
.web-badge.is-perm  { background: #5B34E8; color: #fff; }     /* วัดได้ 6.77:1 */
.web-badge.is-month { background: #FFB454; color: #1F1503; }  /* วัดได้ 10.2:1 */
/* จำกัดบรรทัดให้การ์ดสูงเท่ากันเหมือนต้นฉบับ (ข้อมูลจริงยาวไม่เท่ากัน) */
.web-name {
  font-size: 14.5px; font-weight: 700; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
/* ดีไซน์ต้นฉบับใช้คำอธิบายสั้น 1 บรรทัด (การ์ดสูง 178px / กริดสูง 399px)
   ของจริงในฐานข้อมูลยาวกว่ามาก จึงเปิดไว้ 2 บรรทัด (การ์ด 197px / กริด 439px = สูงกว่าต้นฉบับ 40px)
   ทุกการ์ดสูงเท่ากันเสมอเพราะถูกตัดที่ 2 บรรทัดตายตัว
   ถ้าต้องการสูงเท่าต้นฉบับเป๊ะ ให้เปลี่ยนเป็น -webkit-line-clamp: 1 */
.web-desc {
  font-size: 12px; color: var(--mut); line-height: 1.65; margin: 7px 0 14px; text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.web-foot { margin-top: auto; padding-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* ราคาเต็มขีดฆ่า + ป้ายลดกี่% — เว็บเก่ามีอยู่แล้ว ถ้าตัดทิ้งลูกค้าจะไม่รู้ว่ากำลังได้ส่วนลด */
.web-was { font-size: 11.5px; color: var(--mut); margin-bottom: 1px; }
.web-was s { opacity: .75; }
.web-off { color: var(--bad-ink); font-weight: 700; }
.web-price { font-family: var(--font-num); font-weight: 700; font-size: 21px; color: var(--accent-ink); }
.row-was { font-size: 10.5px; color: var(--mut); font-weight: 400; margin-right: 3px; }
.web-price small { font-size: 10.5px; color: var(--mut); font-weight: 400; font-family: var(--font-th); }
.btn-info {
  border: 1px solid var(--line); background: var(--card2); color: var(--text);
  padding: 9px 17px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.btn-info:hover { border-color: var(--accent); color: var(--text); }

/* =====================================================================
   แบนเนอร์ LINE Flex
   ===================================================================== */
.flex-banner {
  position: relative; overflow: hidden; margin-top: 56px; border-radius: 22px;
  background: linear-gradient(115deg, #047857, #22C55E); padding: 36px 42px; color: #fff;
}
/* มีรูป = แบนเนอร์เต็มความกว้างด้านบน ข้อความอยู่ใต้ภาพ / ไม่มีรูป = โครงเดิมตามดีไซน์ */
.flex-banner.has-shot { padding: 0; }
.flex-banner.has-shot .flex-inner { max-width: 100%; padding: 28px 42px 34px; }
.flex-banner .c1 { position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 99px; background: rgba(255,255,255,.12); }
.flex-banner .art { position: absolute; right: 66px; top: 50%; transform: translateY(-50%); opacity: .3; }
.flex-inner { position: relative; max-width: 66%; }
/* แบนเนอร์เต็มความกว้าง ไม่มีขอบมน/เอียงแล้ว เพราะกินพื้นที่เต็มหัวการ์ด
   aspect-ratio จองพื้นที่ไว้ล่วงหน้า ไม่งั้นตอนรูป lazy โหลดเสร็จ เนื้อหาข้างล่างจะกระโดด (CLS)
   3.6 = สัดส่วนจริงของแบนเนอร์ไลน์บอททุกใบ (1080x300) */
.flex-shot { position: relative; display: block; overflow: hidden; }
.flex-shot img {
  width: 100%; height: auto; display: block;
  aspect-ratio: 3.6; object-fit: cover; background: rgba(255,255,255,.15);
}
/* ไล่เฉดเชื่อมขอบล่างของรูปเข้ากับพื้นเขียวของแบนเนอร์ ไม่ให้ดูเป็นรอยต่อแข็ง ๆ */
.flex-shot::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(180deg, transparent, rgba(4, 120, 87, .85));
  pointer-events: none;
}
.flex-badge { background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.4); font-size: 11.5px; font-weight: 700; padding: 5px 13px; border-radius: 999px; }
.flex-title { font-size: 26px; font-weight: 700; margin: 14px 0 8px; line-height: 1.35; }
.flex-desc { font-size: 13.5px; opacity: .88; line-height: 1.7; }
.flex-cta {
  display: inline-block; margin-top: 18px; border: 0; background: #fff; color: #047857;
  padding: 12px 24px; border-radius: 11px; font-size: 13.5px; font-weight: 700;
}
.flex-cta:hover { transform: translateY(-1px); color: #047857; }

/* =====================================================================
   3 ขั้นตอน + CTA
   ===================================================================== */
.steps-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 16px 0 0; align-items: stretch; }
.steps h3 { margin: 0 0 18px; font-size: 19px; font-weight: 700; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; }
.step-n {
  width: 32px; height: 32px; border-radius: 10px; background: var(--accsoft); color: var(--accent-ink);
  display: grid; place-items: center; font-family: var(--font-num); font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.step-t { font-weight: 600; font-size: 14.5px; }
.step-d { color: var(--mut); font-size: 12.5px; line-height: 1.6; margin-top: 3px; }
.cta-card {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); border-radius: 20px; padding: 26px;
  color: #fff; box-shadow: var(--glow); display: flex; flex-direction: column; justify-content: center;
}
.cta-title { font-weight: 700; font-size: 22px; }
.cta-desc { font-size: 13.5px; opacity: .85; margin: 8px 0 18px; line-height: 1.65; }
.cta-btn {
  align-self: flex-start; border: 0; background: #fff; color: var(--accent);
  padding: 12px 24px; border-radius: 11px; font-size: 13.5px; font-weight: 700; display: inline-block;
}
.cta-btn:hover { transform: translateY(-1px); color: var(--accent); }

/* =====================================================================
   FOOTER
   ===================================================================== */
.foot { border-top: 1px solid var(--line); margin-top: 64px; padding: 38px 4px 14px; text-align: left; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 30px; }
.foot-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.foot-logo {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center; color: #fff; font-family: var(--font-num); font-weight: 700; font-size: 15px;
}
.foot-logo.has-img { width: auto; min-width: 32px; max-width: 150px; border-radius: 8px;
  background: none; padding: 0; overflow: hidden; }
.foot-logo.has-img img { height: 32px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.foot-name { font-family: var(--font-num); font-weight: 700; font-size: 15px; letter-spacing: .04em; }
.foot-tag { font-size: 10px; color: var(--mut); letter-spacing: .18em; margin-top: -2px; }
.foot-about { font-size: 12.5px; color: var(--mut); line-height: 1.75; max-width: 340px; text-wrap: pretty; }
.foot-pills { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.foot-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--card); color: var(--mut);
  font-size: 11.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
}
.foot-pill i { width: 7px; height: 7px; border-radius: 99px; display: block; }
.foot-col-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--text); margin-bottom: 14px; }
.foot-links { display: flex; flex-direction: column; gap: 11px; font-size: 12.5px; }
.foot-bottom {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); margin-top: 30px; padding-top: 18px;
  color: var(--mut); font-size: 12px; flex-wrap: wrap; gap: 10px;
}
.foot-bottom-links { display: flex; gap: 20px; }

/* =====================================================================
   จอเล็ก
   ===================================================================== */
@media (max-width: 860px) {
  .hero-decor { display: none; }   /* ตรงกับดีไซน์: --heroCards:none ที่ 1360px */
}

/* การ์ดบริการ 4 ใบต่อแถวเริ่มแคบเกินอ่านเมื่อพื้นที่เนื้อหาต่ำกว่า ~1090px */
@media (max-width: 1150px) {
  .pop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ต้นฉบับใช้ 4 คอลัมน์ (การ์ด) และ 3 คอลัมน์ (เว็บ) คงที่ ไม่มี breakpoint กลาง
   จึงคงไว้จนถึง 900px แล้วค่อยยุบ เพื่อให้หน้าตาตรงต้นฉบับบนจอโน้ตบุ๊ก/เดสก์ท็อป */
@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .web-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrap { padding: 16px 18px 0; }
  /* .nav-links ถือ margin-left:auto ไว้เป็นตัวดันปุ่มไปชิดขวา
     พอซ่อนมันที่จอเล็ก ตัวดันก็หายไปด้วย ปุ่มเลยมากองติดโลโก้ — ต้องย้าย auto มาไว้ที่ .nav-actions */
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .nav-burger { display: grid; }
  .nav { gap: 12px; padding: 10px 12px; }
  .nav-mobile.is-open { display: block; }
  .hero { padding: 44px 0 24px; }
  .hero h1 { font-size: clamp(30px, 7vw, 44px); }
  .hero-lead { font-size: 15px; }
  /* สไลด์ยังเป็นการ์ดซ้อนเหมือนเดิม แต่กว้างเต็มจอและสูงขึ้นให้ข้อความพอดี
     (ห้ามปล่อยให้กางเรียงลงมาทีละใบ — จะไม่ใช่ carousel อีกต่อไป) */
  .slides { height: 318px; margin: 26px 0 40px; }
  .slide { width: 100%; height: 290px; }
  .slide-inner { max-width: 100%; padding: 24px; }
  .slide-title { font-size: 20px; margin: 10px 0 6px; }
  .slide-sub { font-size: 12.5px; -webkit-line-clamp: 2; }
  .slide .art { right: -10px; top: 60px; opacity: .18; }
  .slide .c2 { display: none; }
  .sec-head { padding: 44px 0 6px; }
  .sec-head.tight { padding: 40px 0 4px; }
  .sec-head h2 { font-size: 24px; }
  /* กล่องคู่ซ้อนกันแนวตั้ง กล่องไลน์บอทได้ความกว้างเต็ม วางแบนเนอร์ได้ 3 ใบต่อแถว */
  .duo, .steps-grid { grid-template-columns: minmax(0, 1fr); }
  .duo { padding-top: 36px; }
  .bot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flex-banner { margin-top: 36px; padding: 28px 24px; }
  .flex-banner.has-shot { padding: 0; }
  .flex-banner.has-shot .flex-inner { padding: 22px 24px 26px; }
  .flex-inner { max-width: 100%; }
  .flex-banner .art { display: none; }
  .flex-title { font-size: 21px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .nav-dock { top: 8px; }
}
@media (max-width: 640px) {
  .wrap { padding: 14px 14px 0; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .web-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .foot-bottom { justify-content: center; text-align: center; }
  .btn-login { display: none; }               /* ย้ายไปอยู่ในเมนูมือถือแทน */
  .nav-brand > span > .nav-tag { display: none !important; }

  /* สไลด์: สูงขึ้นอีกเพราะตัวอักษรขึ้นบรรทัดมากกว่า */
  .slides { height: 300px; margin: 22px 0 36px; }
  .slide { height: 272px; border-radius: 18px; }
  .slide-inner { padding: 20px; }
  .slide-title { font-size: 18px; }
  .slide .art { display: none; }

  /* ปุ่มหลักเต็มความกว้าง กดง่ายด้วยนิ้ว */
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn-hero-primary, .btn-hero-ghost { width: 100%; justify-content: center; padding: 14px 20px; font-size: 15px; }

  .hero-chips { gap: 8px; margin-top: 28px; }
  .hero-chip { font-size: 12px; padding: 7px 12px; }
  .hero-badge .txt { font-size: 11.5px; }

  .pop { padding: 14px; }
  .pop-meta { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .panel { padding: 20px; }
  .web-body { padding: 14px 16px 16px; }
  /* มือถือ: การ์ดบอทเหลือคอลัมน์เดียว แบนเนอร์จะได้กว้างพอให้อ่านตัวหนังสือในภาพออก
     (2 คอลัมน์ที่ 430px เหลือแบนเนอร์แค่ 166x46 px) */
  .bot-grid { grid-template-columns: minmax(0, 1fr); }

  /* ปุ่มบนจอสัมผัสต้องสูงอย่างน้อย 44px ตามเกณฑ์ที่นิ้วกดไม่พลาด */
  .pop-buy, .row-buy, .btn-info, .btn-more { min-height: 44px; }
  .row-buy, .btn-info { display: inline-flex; align-items: center; justify-content: center; }
  .btn-more { display: inline-flex; align-items: center; justify-content: center; }
  /* ลิงก์ในส่วนท้ายสูงแค่ 16px กดยาก — ขยายพื้นที่กดด้วย padding แล้วหักที่ gap
     ระยะห่างที่ตาเห็นเท่าเดิม แต่นิ้วได้พื้นที่ 24px */
  .foot-links { gap: 3px; }
  .foot-links a { padding: 4px 0; }
  .foot-bottom-links a { padding: 5px 0; display: inline-block; }
  .cta-card { padding: 22px; }
  .cta-title { font-size: 19px; }
  .flex-title { font-size: 19px; }
  .pf-row { gap: 16px; }
  .pf { font-size: 13px; }
}

/* จอมือถือแนวตั้ง: การ์ดบริการเหลือคอลัมน์เดียว อ่านง่ายกว่า 2 ใบเบียดกัน
   min-height ของชื่อต้องปลดตรงนี้ ไม่ใช่ที่ 640px — ช่วง 521-640px ยังเป็น 2 คอลัมน์อยู่
   ถ้าปลดเร็วไป การ์ดที่ชื่อสั้นกับชื่อยาวจะมีราคาอยู่คนละระดับ มองแล้วเหลื่อมกัน */
@media (max-width: 520px) {
  .pop-grid { grid-template-columns: minmax(0, 1fr); }
  .pop-name { min-height: 0; }
}

@media (max-width: 420px) {
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .slides { height: 320px; }
  .slide { height: 292px; }
  .sec-head h2 { font-size: 21px; }
  .web-foot { flex-direction: column; align-items: flex-start; gap: 12px; }
  .btn-info { width: 100%; text-align: center; }
  /* แถวสินค้า: ชื่อขึ้นบรรทัดบนเต็มความกว้าง แล้วรูป/ราคา/ปุ่มอยู่บรรทัดล่าง */
  .row { flex-wrap: wrap; }
  .row-name { flex: 1 1 100%; order: -1; white-space: normal; }
  .row-ico { width: 38px; height: 38px; border-radius: 10px; }
  .flex-banner { padding: 24px 18px; }
  .flex-banner.has-shot { padding: 0; }
  .flex-banner.has-shot .flex-inner { padding: 20px 18px 24px; }
  .bot-name { min-height: 0; }
}

/* จอแคบสุดที่ยังต้องรองรับ (iPhone SE รุ่นเก่า 320px)
   แถบเมนูมี โลโก้ + ปุ่มธีม + ปุ่มเมนู + ปุ่มสมัคร รวมกันแล้วล้นออกนอกจอ ต้องบีบทุกชิ้นลง */
@media (max-width: 380px) {
  .nav { gap: 8px; padding: 8px 8px 8px 12px; }
  .nav-actions { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; }
  .nav-logo { width: 30px; height: 30px; font-size: 15px; }
  .nav-title { font-size: 15px; }
  .btn-register { padding: 9px 14px; font-size: 12.5px; }
}

/* =====================================================================
   หน้ารวมบริการ /services
   ===================================================================== */
.svc-head { text-align: center; padding: 44px 0 8px; }
.svc-head h1 { margin: 0 0 12px; font-size: clamp(28px, 4vw, 40px); font-weight: 700; line-height: 1.25; }
.svc-head > p { margin: 0 auto; max-width: 640px; color: var(--mut); font-size: 15px; line-height: 1.75; text-wrap: pretty; }
.svc-head strong { color: var(--text); font-family: var(--font-num); }

/* ---------- ช่องค้นหา ---------- */
.svc-search {
  position: relative; display: flex; gap: 8px; align-items: center;
  max-width: 620px; margin: 24px auto 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 6px 6px 46px; box-shadow: var(--shadow);
}
.svc-search:focus-within { border-color: var(--accent); }
.svc-search-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: grid; pointer-events: none; }
.svc-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font-family: inherit; font-size: 14px; padding: 10px 0; outline: none;
}
.svc-search input::placeholder { color: var(--mut); }
.svc-search button {
  flex: none; border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  padding: 11px 24px; border-radius: 999px; font-size: 13.5px; font-weight: 600; box-shadow: var(--glow);
}
.svc-search button:hover { filter: brightness(1.08); }

/* ---------- แถบเลือกแพลตฟอร์ม ---------- */
.cat-bar {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 30px 0 4px;
}
.cat-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 8px 14px 8px 10px; border-radius: 999px; font-size: 13px; font-weight: 500;
  transition: border-color .18s ease, background-color .18s ease;
}
.cat-chip:hover { border-color: var(--accent); color: var(--text); }
.cat-chip.is-active { border-color: var(--accent); background: var(--accsoft); color: var(--accent-ink); font-weight: 600; }
.cat-chip-ico { position: relative; width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
.cat-chip-ico img {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 20px; object-fit: contain;
}
.cat-chip-name { white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.cat-chip-n {
  font-family: var(--font-num); font-size: 11px; font-weight: 700;
  /* --mut บน --chipbg ได้ 4.35:1 ไม่ผ่านเกณฑ์ 4.5:1 ของตัวอักษรเล็ก */
  background: var(--chipbg); color: var(--text); padding: 2px 7px; border-radius: 999px;
}
.cat-chip.is-active .cat-chip-n { background: var(--card); color: var(--accent-ink); }

/* ---------- แถบสรุปผล + เรียงลำดับ ---------- */
.svc-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 26px 0 0;
}
.svc-count { font-size: 13.5px; color: var(--mut); }
.svc-count strong { color: var(--text); font-family: var(--font-num); }
.svc-sorts { display: flex; gap: 4px; flex-wrap: wrap; }
.svc-sort {
  border: 1px solid transparent; background: transparent; color: var(--mut);
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
}
.svc-sort:hover { background: var(--chipbg); color: var(--text); }
.svc-sort.is-active { background: var(--accsoft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.svc-clear { display: inline-block; margin-top: 12px; font-size: 12.5px; font-weight: 600; }

/* ---------- การ์ดบริการ ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 20px 0 0; }
.svc {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; text-align: left;
  transition: transform .18s ease, border-color .18s ease;
}
.svc:hover { border-color: var(--accent); transform: translateY(-2px); }
/* บริการที่กดมาจากหน้าแรก — ตีกรอบให้เห็นชัดว่าคือใบไหน */
.svc.is-pinned { border-color: var(--accent); box-shadow: var(--glow); }

.svc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.svc-ico {
  position: relative; width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; overflow: hidden;
}
.svc-ico img {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 22px; height: 22px; object-fit: contain;
}
.svc-id { font-family: var(--font-num); font-size: 11.5px; font-weight: 700; color: var(--mut); }
.svc-tag {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--chipbg); color: var(--text); white-space: nowrap;   /* เหตุผลเดียวกับ .cat-chip-n */
}
.svc-tag.is-good { background: var(--goodsoft); color: var(--good-ink); }

/* ชื่อบริการจริงยาวเฉลี่ย 53 ตัวอักษร ยาวสุด 166 — ล็อก 2 บรรทัดให้การ์ดสูงเท่ากันทุกใบ */
.svc-name {
  margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.45; min-height: 2.9em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.svc-price-row { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.svc-price { font-family: var(--font-num); font-weight: 700; font-size: 15px; color: var(--accent-ink); }
.svc-price small { font-size: 10.5px; color: var(--mut); font-weight: 400; font-family: var(--font-th); }
.svc-meta {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px;
  font-size: 11.5px; color: var(--mut);
  border-top: 1px solid var(--line); padding-top: 11px; margin: 12px 0 12px;
}
.svc-meta div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.svc-meta svg { flex: none; }
.svc-meta .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-meta .up { color: var(--good-ink); font-weight: 700; }
.svc-meta .down { color: var(--warn-ink); font-weight: 700; }
.svc-buy {
  margin-top: auto; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  padding: 11px; border-radius: 11px; font-size: 12.5px; font-weight: 600; box-shadow: var(--glow);
}
.svc-buy:hover { filter: brightness(1.08); color: #fff; }

.svc-pinned-wrap { padding-top: 20px; }
.svc-pinned-label { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); margin-bottom: 2px; }
.svc-pinned-wrap .svc-grid { padding-top: 8px; }

/* ---------- ไม่พบผลลัพธ์ ---------- */
.svc-empty {
  text-align: center; padding: 60px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; margin-top: 20px;
}
.svc-empty-ico { display: grid; place-items: center; margin-bottom: 12px; opacity: .5; }
.svc-empty-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.svc-empty p { margin: 0 0 20px; color: var(--mut); font-size: 13.5px; }

/* ---------- แบ่งหน้า ---------- */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 32px 0 8px;
}
.pager-nums { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pager-num, .pager-step {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 11px; font-size: 13px; font-weight: 600; font-family: var(--font-num);
}
.pager-num:hover, .pager-step:hover { border-color: var(--accent); color: var(--text); }
.pager-num.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent; color: #fff; box-shadow: var(--glow);
}
.pager-step { font-family: var(--font-th); }
.pager-step.is-off { opacity: .4; pointer-events: none; }
.pager-gap { color: var(--mut); padding: 0 2px; }

@media (max-width: 900px) {
  .svc-head { padding: 30px 0 4px; }
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-chip-name { max-width: 130px; }
  /* ชิป 18 อันตัดบรรทัดบนมือถือกินความสูงเกือบ 500px ลูกค้าต้องเลื่อนผ่านเกือบเต็มจอ
     กว่าจะเห็นสินค้าใบแรก จึงเปลี่ยนเป็นแถบเลื่อนแนวนอนแถวเดียวแทน */
  .cat-bar {
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; scroll-snap-type: x proximity;
    padding: 20px 0 12px; margin: 0 -18px; padding-left: 18px; padding-right: 18px;
    -webkit-overflow-scrolling: touch;
  }
  .cat-bar::-webkit-scrollbar { height: 4px; }
  .cat-chip { flex: none; scroll-snap-align: start; }
}
@media (max-width: 640px) {
  .svc-grid { grid-template-columns: minmax(0, 1fr); }
  .svc-meta { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .svc-name { min-height: 0; }
  .svc-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .svc-sorts { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .svc-sort { white-space: nowrap; }
  .svc-buy, .svc-search button { min-height: 44px; }
  .pager-num, .pager-step { min-width: 44px; height: 44px; }
}
@media (max-width: 420px) {
  .svc-search { padding-left: 40px; }
  .svc-search-ico { left: 13px; }
  .svc-search button { padding: 11px 16px; }
  .cat-chip { padding: 7px 12px 7px 9px; font-size: 12.5px; }
}

/* =====================================================================
   โครงแผงควบคุม (เมนูซ้าย) — ค่าถอดตรงจากดีไซน์หน้า order ในต้นฉบับ
   ===================================================================== */
.shell { display: flex; min-height: 100vh; }

.side {
  width: 252px; flex: none; background: var(--bg2); border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: inherit; }
.side-logo {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-num); font-weight: 700; font-size: 17px; box-shadow: var(--glow);
}
.side-logo.has-img { width: auto; min-width: 36px; max-width: 160px; border-radius: 10px; background: none; box-shadow: none; overflow: hidden; }
.side-logo.has-img img { height: 36px; width: auto; max-width: 160px; object-fit: contain; display: block; }

/* มาตรวัดความแข็งแรงรหัสผ่าน (JS แทรกหลัง input[data-strength]) */
.pw-meter { margin: 7px 0 2px; display: none; align-items: center; gap: 9px; }
.pw-meter.is-on { display: flex; }
.pw-meter-bars { display: flex; gap: 4px; flex: none; }
.pw-seg { width: 26px; height: 5px; border-radius: 99px; background: var(--line); transition: background .15s ease; }
.pw-seg.on.lv1 { background: var(--bad-ink); }
.pw-seg.on.lv2 { background: var(--warn-ink); }
.pw-seg.on.lv3 { background: #d9a400; }
.pw-seg.on.lv4 { background: var(--good-ink); }
.pw-meter-label { font-size: 12px; font-weight: 600; line-height: 1.3; }
.pw-meter.lv1 .pw-meter-label { color: var(--bad-ink); }
.pw-meter.lv2 .pw-meter-label { color: var(--warn-ink); }
.pw-meter.lv3 .pw-meter-label { color: #b07d00; }
.pw-meter.lv4 .pw-meter-label { color: var(--good-ink); }
.side-name { display: block; font-family: var(--font-num); font-weight: 700; font-size: 15.5px; letter-spacing: .04em; }
.side-tag { display: block; font-size: 9.5px; color: var(--mut-ink); letter-spacing: .18em; margin-top: -2px; }

.side-user {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px;
}
.side-avatar {
  width: 34px; height: 34px; border-radius: 99px; flex: none;
  background: var(--accsoft); color: var(--accent-ink); display: grid; place-items: center;
}
.side-user-txt { min-width: 0; }
.side-user-name { display: block; font-size: 13px; font-weight: 600; }
.side-user-sub { display: block; font-size: 11px; color: var(--mut-ink); }
.side-user-wallet { font-family: var(--font-num); font-size: 12.5px; font-weight: 600; color: var(--accent-ink); flex: none; }
.side-user.is-guest { color: var(--text); }
.side-user.is-guest:hover { border-color: var(--accent); }
.logout-form { display: inline-flex; }

.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid transparent; background: transparent; color: var(--mut);
  padding: 11px 13px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  color: var(--mut-ink);
}
.side-item:hover { background: var(--chipbg); color: var(--text); }
.side-item.is-active {
  border-color: var(--accent); background: linear-gradient(135deg, var(--accsoft), transparent);
  color: var(--accent-ink);
}
.side-item-label { flex: 1; min-width: 0; }
.side-arrow { color: var(--accent-ink); }
/* หน้าที่ยังไม่ได้ทำ — บอกตรง ๆ ว่ายังไม่มี ดีกว่าปล่อยให้กดแล้วเจอ 404 */
.side-item.is-soon { opacity: .55; cursor: default; }
.side-item.is-soon:hover { background: transparent; color: var(--mut-ink); }
.side-soon {
  font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--chipbg); color: var(--text); white-space: nowrap;
}

/* ---------- เมนูย่อยในกลุ่ม ---------- */
.side-group.is-open { color: var(--text); }
.side-sub {
  display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 4px 30px; padding-left: 12px; border-left: 1px solid var(--line);
}
.side-subitem {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 10px;
  color: var(--mut-ink); font-size: 12.5px; font-weight: 500;
}
.side-subitem:hover { background: var(--chipbg); color: var(--text); }
.side-subitem.is-active { background: var(--accsoft); color: var(--accent-ink); font-weight: 600; }
.side-subitem.is-soon { opacity: .55; cursor: default; }
.side-subitem.is-soon:hover { background: transparent; color: var(--mut-ink); }
.side-subitem .side-soon { margin-left: auto; }
.side-subitem .side-arrow { margin-left: auto; }

.side-note {
  margin-top: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
}
.side-note-title { font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.side-note p { margin: 0; font-size: 11.5px; color: var(--mut-ink); line-height: 1.65; }
.side-back {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
  padding: 10px 13px; border-radius: 12px; color: var(--mut-ink); font-size: 12.5px; font-weight: 500;
}
.side-back:hover { background: var(--chipbg); color: var(--text); }

/* ต้อง clip ตรงนี้ด้วย — หน้า panel ไม่มี .page ห่ออยู่เหมือนหน้าอื่น
   ตารางบริการกว้าง 840px จึงดันให้ทั้งหน้าเลื่อนซ้ายขวาได้บนมือถือ
   (clip ไม่ทำให้ sticky ของแถบบนเสีย และไม่ตัด sidebar ที่เป็น position:fixed) */
.panel-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
.topbar {
  padding: 18px 0;
  border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.topbar-burger { display: none; }
.topbar-titles { min-width: 0; }
.topbar-h { font-size: 17px; font-weight: 700; }
.topbar-sub { font-size: 12px; color: var(--mut); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* margin-inline: auto ต้องมี ไม่งั้นเนื้อหาไปกองชิดซ้ายและเหลือที่ว่างทางขวาเป็นแถบใหญ่
   บนจอกว้าง ๆ (max-width จำกัดความกว้างให้แล้ว แต่ไม่ได้จัดกึ่งกลางให้) */
.panel-content { padding: 26px 30px 40px; max-width: 1160px; width: 100%; min-width: 0; margin-inline: auto; }
/* แถบบนต้องจัดกึ่งกลางให้ตรงกับเนื้อหาด้วย ไม่งั้นชื่อหน้ากับเนื้อหาจะเยื้องกัน */
.topbar-inner {
  display: flex; align-items: center; gap: 14px;
  max-width: 1160px; width: 100%; margin-inline: auto; padding: 0 30px;
}

/* ---------- ชิปสายบริการ ---------- */
.line-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.line-chip {
  border: 1px solid var(--line); background: var(--card); color: var(--mut);
  padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.line-chip:hover { border-color: var(--accent); color: var(--text); }
.line-chip.is-active { border-color: var(--accent); background: var(--accsoft); color: var(--accent-ink); }

/* ---------- แถบค้นหา + ตัวกรอง ---------- */
.pf-tools { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.pf-search {
  flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 5px 6px 5px 15px;
}
.pf-search:focus-within { border-color: var(--accent); }
.pf-search svg { flex: none; }
.pf-search input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  color: var(--text); font-family: inherit; font-size: 13.5px; padding: 9px 0;
}
.pf-search button {
  flex: none; border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  padding: 10px 20px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
}
.pf-search button:hover { filter: brightness(1.08); }
.pf-sorts { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pf-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--card); color: var(--mut);
  padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.pf-pill:hover { border-color: var(--accent); color: var(--text); }
.pf-pill.is-active { border-color: var(--accent); background: var(--accsoft); color: var(--accent-ink); }
.pf-pill b { font-family: var(--font-num); font-size: 11px; color: var(--text); font-weight: 700; }
.pf-pill.is-active b { color: var(--accent-ink); }
.pf-pill-ico { position: relative; width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.pf-pill-ico img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 16px; height: 16px; object-fit: contain; }
.pf-pill-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-count { font-size: 13px; color: var(--mut); margin-bottom: 12px; }
.pf-count strong { color: var(--text); font-family: var(--font-num); }
.pf-clear { margin-left: 8px; font-size: 12.5px; font-weight: 600; }

/* ---------- ตารางบริการ ---------- */
.tbl-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
.tbl { min-width: 840px; }
.tr {
  /* รหัส | บริการ | ราคา/1,000 | ขั้นต่ำ–สูงสุด | ปุ่มสั่งซื้อ (เอาคอลัมน์ "ยอดสั่งซื้อ" ออกแล้ว) */
  display: grid; grid-template-columns: 82px minmax(0, 1fr) 108px 148px 92px;
  gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); align-items: center;
}
.tr:last-child { border-bottom: 0; }
.tr.th { font-size: 11px; color: var(--mut); font-weight: 600; letter-spacing: .05em; }
.tr:not(.th):hover { background: var(--card2); }
.tr.is-pinned { background: var(--accsoft); }
.td-id {
  justify-self: start; background: var(--accsoft); color: var(--accent-ink);
  font-family: var(--font-num); font-size: 11.5px; font-weight: 700;
  padding: 4px 8px; border-radius: 8px;
}
.td-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.td-ico { position: relative; width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; overflow: hidden; }
.td-ico img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 19px; height: 19px; object-fit: contain; }
/* มีรูปจริงแล้ว = ซ่อนไอคอน svg สำรอง ไม่ให้ทับกัน (svg เป็น fallback เฉพาะตอนไม่มีรูป)
   ครอบทุก "ช่องไอคอน" ที่คลาสลงท้าย -ico (td-ico, otp-card-ico, otp-svc-ico, pop-ico ฯลฯ)
   — ช่องที่มีแต่ svg (ไม่มี img) ไม่โดนแตะ เพราะ :has(img) เป็นเท็จ */
[class$="-ico"]:has(img) svg { display: none; }
.td-name-txt { min-width: 0; }
.td-title {
  display: block; font-size: 13px; font-weight: 600; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.td-sub { display: block; font-size: 11px; color: var(--mut); margin-top: 2px; }
.td-tag {
  display: inline-block; font-style: normal; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; background: var(--chipbg); color: var(--text); margin-left: 5px;
}
.td-tag.is-good { background: var(--goodsoft); color: var(--good-ink); }
.td-price { font-family: var(--font-num); font-size: 13.5px; font-weight: 600; }
.td-mut { font-size: 12px; color: var(--mut); }
.td-buy {
  display: block; text-align: center; border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  padding: 8px 0; border-radius: 9px; font-size: 12px; font-weight: 600;
}
.td-buy:hover { filter: brightness(1.08); color: #fff; }

/* =====================================================================
   ประวัติคำสั่งซื้อ /orders_socialup
   ===================================================================== */
.stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat span { font-size: 11.5px; color: var(--mut); }
.stat b { font-family: var(--font-num); font-size: 20px; }
.stat b.good { color: var(--good-ink); }
.stat b.info { color: var(--info-ink); }
.stat b.bad  { color: var(--bad-ink); }

/* ตารางประวัติมี 7 คอลัมน์ — กว้างกว่าตารางบริการ */
.tbl-orders { min-width: 1100px; }
.tbl-orders .tr { grid-template-columns: 92px minmax(0, 1.3fr) 140px 122px 88px 112px 106px 84px; }
/* ปุ่มสั่งซ้ำ — สั่งของเดิมได้ในคลิกเดียว */
.td-again {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--line); background: var(--card2); color: var(--accent-ink);
  padding: 7px 0; border-radius: 9px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.td-again:hover { border-color: var(--accent); background: var(--accsoft); color: var(--accent-ink); }
.td-again svg { flex: none; }
.td-link { min-width: 0; font-size: 12px; }
.td-link a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.td-prog { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--mut); }
.td-prog-num { font-family: var(--font-num); }
.bar { display: block; height: 5px; background: var(--chipbg); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.badge.is-good { background: var(--goodsoft); color: var(--good-ink); }
.badge.is-info { background: var(--infosoft); color: var(--info-ink); }
.badge.is-warn { background: var(--warnsoft); color: var(--warn-ink); }
.badge.is-bad  { background: var(--badsoft);  color: var(--bad-ink); }
.badge.is-mut  { background: var(--chipbg);   color: var(--text); }
.dot { width: 7px; height: 7px; border-radius: 99px; display: inline-block; flex: none; }
.dot.is-good { background: var(--good); } .dot.is-info { background: var(--info); }
.dot.is-warn { background: var(--warn); } .dot.is-bad { background: var(--bad); }

/* หน้าที่ต้องล็อกอินก่อนถึงจะดูได้ */
.ord-locked {
  text-align: center; max-width: 560px; margin: 40px auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 44px 28px;
}
.ord-locked-ico { display: grid; place-items: center; margin-bottom: 14px; }
.ord-locked h2 { margin: 0 0 10px; font-size: 21px; font-weight: 700; }
.ord-locked > p { margin: 0 0 22px; color: var(--mut); font-size: 13.5px; line-height: 1.75; }
.ord-locked-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ord-locked-note { margin: 22px 0 0; font-size: 12px; color: var(--mut); line-height: 1.7; }

@media (max-width: 1000px) {
  .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 13px; }
  .stat b { font-size: 17px; }
  /* ตารางประวัติกลายเป็นการ์ดเหมือนตารางบริการ */
  .tbl-orders { min-width: 0; }
  .tbl-orders .tr { grid-template-columns: minmax(0, 1fr) auto; }
  .tbl-orders .td-link, .tbl-orders .td-prog { grid-column: 1 / -1; }
  .td-again { grid-column: 1 / -1; min-height: 40px; }
}

/* =====================================================================
   ประวัติซื้อบัญชีโซเชียล /accounts/mine + modal /accounts/view
   ===================================================================== */
/* app.css เดิมมีแค่ .ord-alert.is-ok / .is-err — เพิ่มโทนเหลืองให้ครบ (ใช้ใน modal ด้วย) */
.ord-alert.is-warn { background: var(--warnsoft); border: 1px solid var(--warn); color: var(--text); }

/* ตาราง 7 คอลัมน์: สินค้า | จำนวน | ยอดชำระ | สถานะ | วันที่ | Trans ID | ดูบัญชี */
.tbl-accounts { min-width: 960px; }
.tbl-accounts .tr { grid-template-columns: minmax(0, 1.6fr) 78px 104px 118px 112px minmax(0, 0.9fr) 128px; }
.td-acc-qty { font-family: var(--font-num); }
.td-acc-trans { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-num); font-size: 11.5px; }
.td-acc-act { min-width: 0; }
.acc-view-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; width: 100%; padding: 9px 14px; }
.acc-view-btn svg { flex: none; }

/* ปุ่มคัดลอก Trans ID แบบอินไลน์ (ในตาราง + ใน modal) — ดูเหมือนข้อความ มีไอคอนคัดลอกเล็ก ๆ */
.acc-trans-copy {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; vertical-align: middle;
  padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--card2); color: var(--text); font-family: var(--font-num); font-size: 11.5px;
  cursor: pointer; overflow: hidden;
}
.acc-trans-copy .acc-trans-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.acc-trans-copy svg { flex: 0 0 auto; opacity: .7; }
.acc-trans-copy:hover { border-color: var(--accent); color: var(--accent-ink); }
.acc-trans-copy.is-copied { background: var(--goodsoft); color: var(--good-ink); border-color: var(--good); }

@media (max-width: 640px) {
  /* จอเล็ก: ยุบเป็นการ์ดต่อแถว (กฎ .tbl ที่ 640px ซ่อนหัวตาราง + ทำ .tr เป็น 2 คอลัมน์ให้แล้ว) */
  .tbl-accounts { min-width: 0; }
  .tbl-accounts .tr { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .tbl-accounts .td-name { order: -1; grid-column: 1 / -1; }
  .tbl-accounts .td-price { justify-self: end; font-size: 15px; }
  .tbl-accounts .td-acc-trans { grid-column: 1 / -1; white-space: normal; overflow-wrap: anywhere; }
  .tbl-accounts .td-acc-act { grid-column: 1 / -1; }
  .tbl-accounts .acc-view-btn { min-height: 42px; }
}

/* ---- กล่อง modal ดูบัญชี ---- */
.acc-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.acc-modal[hidden] { display: none; }
.acc-modal-backdrop {
  position: absolute; inset: 0; border: 0; cursor: pointer;
  background: rgba(8, 8, 20, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.acc-modal-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 22px 24px; outline: none;
}
.acc-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.acc-modal-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin: 0; }
.acc-modal-title svg { flex: none; }
.acc-modal-x {
  border: 0; background: var(--card2); color: var(--text); flex: none;
  width: 34px; height: 34px; border-radius: 10px; font-size: 22px; line-height: 1; cursor: pointer;
}
.acc-modal-x:hover { background: var(--badsoft); color: var(--bad-ink); }
.acc-modal-loading { padding: 34px; text-align: center; color: var(--mut); font-size: 13.5px; }

.acc-order-head { margin-bottom: 6px; }
.acc-order-name { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; margin-bottom: 12px; }
.acc-order-ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; }
.acc-order-ico img { width: 26px; height: 26px; }
.acc-order-name-txt { min-width: 0; flex: 1 1 auto; }
.acc-order-name-txt .td-title { display: block; font-size: 15px; max-width: 100%; white-space: normal; }
.acc-order-cat { display: block; margin-top: 2px; font-size: 12px; color: var(--mut); }
.acc-order-kv { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
/* Trans ID ในลิสต์ kv ยาวกว่าช่องได้ ให้ปุ่มคัดลอกไม่ดันความกว้างจนล้น */
.acc-order-kv .acc-trans-copy { max-width: 200px; }

.acc-cred-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 8px; }
.acc-cred-title { font-size: 14px; font-weight: 700; }
.acc-copy-all { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 7px 14px; }
.acc-copy-all svg { flex: none; }

/* รายการบัญชี — แต่ละรายการเป็นการ์ด: หัว (เลข + ปุ่มคัดลอก) แล้ว textarea เต็มความกว้างข้างล่าง
   *** credential ต้องเห็นครบโดยไม่เลื่อนออกด้านข้าง *** จึงตัดบรรทัด (pre-wrap) + ยืดสูงพอดีเนื้อหา */
.acc-cred-list { display: flex; flex-direction: column; gap: 10px; }
.acc-cred {
  display: flex; flex-direction: column; gap: 7px;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--card2);
}
.acc-cred-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acc-cred-no { font-family: var(--font-num); font-size: 11.5px; font-weight: 700; color: var(--mut); }
.acc-cred-text {
  display: block; width: 100%; box-sizing: border-box;
  min-height: 42px; max-height: 320px; resize: vertical; field-sizing: content;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); color: var(--text);
  font-family: var(--font-num, monospace); font-size: 12.5px; line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; overflow: auto;
}
.acc-cred-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.acc-copy { white-space: nowrap; padding: 6px 13px; }
.acc-cred-warn { display: flex; align-items: flex-start; gap: 6px; margin: 14px 0 0; font-size: 12px; color: var(--mut); line-height: 1.6; }
.acc-cred-warn svg { flex: none; margin-top: 2px; }

@media (max-width: 640px) {
  .acc-modal { padding: 12px; }
  .acc-modal-dialog { padding: 18px 16px; max-height: 92vh; }
  .acc-cred-bar { flex-wrap: wrap; }
  .acc-copy { padding: 10px 14px; min-height: 40px; }
}

/* =====================================================================
   ฟอร์มสั่งซื้อ /neworder_socialup
   ===================================================================== */
.ord-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; align-items: start; }
.ord-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.ord-card-sm { padding: 22px; }
.ord-title { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.ord-sub-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.ord-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--mut); margin-bottom: 7px; }
.ord-select { position: relative; margin-bottom: 16px; }
.ord-select select {
  width: 100%; appearance: none; background: var(--inputbg); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 40px 13px 15px; font-size: 13.5px;
  color: var(--text); font-family: inherit; outline: none;
}
.ord-select select:focus { border-color: var(--accent); }
.ord-select > span {
  position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
  color: var(--mut); pointer-events: none; font-size: 11px;
}
.ord-input {
  width: 100%; background: var(--inputbg); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; font-size: 13.5px; color: var(--text); font-family: inherit; outline: none;
  margin-bottom: 7px;
}
.ord-input:focus { border-color: var(--accent); }
.ord-input:disabled { opacity: .55; }
.ord-hint { font-size: 11.5px; color: var(--mut); margin: 0 0 18px; line-height: 1.6; }
.ord-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ord-total {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 9px;
  background: var(--inputbg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px;
}
.ord-total-ico {
  width: 24px; height: 24px; border-radius: 8px; flex: none;
  background: var(--accsoft); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px;
}
.ord-total-label { font-size: 12.5px; color: var(--mut); }
.ord-total-num { margin-left: auto; font-family: var(--font-num); font-weight: 700; font-size: 15px; }

/* ยอดที่หน้าเว็บ "ยืนยันไม่ได้" ว่าตรงกับยอดที่จะถูกตัด (JS คิดตามสูตรฝั่งเซิร์ฟเวอร์ไม่ได้)
   ต้องดูออกทันทีว่ายังไม่ใช่ยอดสุดท้าย ห้ามให้ดูเหมือนตัวเลขที่ยืนยันแล้ว
   ปกติจะไม่ถูกใช้เลย — โผล่เฉพาะตอนที่ JS ตรวจแล้วพบว่าสูตรสองฝั่งไม่ตรงกัน */
[data-total].is-stale {
  opacity: .6;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.ord-stale-note {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--warnsoft);
  color: var(--warn-ink);
  font-size: 12px;
  line-height: 1.6;
}
.ord-submit {
  /* inline-flex เป็นฐาน — ปุ่มนี้ใช้เป็นได้ทั้ง <button> และ <a> ถ้าไม่ตั้ง display
     <a> จะเป็น display:inline ทำให้ padding แนวตั้งล้นไปทับข้อความรอบ ๆ (เคยเจอที่ปุ่ม "เข้าสู่ระบบเพื่อซื้อ") */
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; text-decoration: none;
  padding: 14px 30px; border-radius: 12px; font-size: 14.5px; font-weight: 700; box-shadow: var(--glow);
}
.ord-submit:hover { filter: brightness(1.08); }

/* ---- สถานะ "กำลังดำเนินการ..." ของปุ่มสั่งซื้อ (กันกดซ้ำ) ---- */
.ord-submit.is-loading {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: progress; opacity: .9;
}
.ord-submit.is-loading:hover { filter: none; }
.ord-submit[disabled] { cursor: not-allowed; }
.ord-spin {
  display: inline-block; width: 15px; height: 15px; flex: none;
  /* วงแหวนหมุน — พื้นสีขาวจาง ขอบบนทึบ (ปุ่มเป็นพื้นแบรนด์ ตัวอักษรขาวอยู่แล้ว) */
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff; border-radius: 50%;
  animation: ord-spin .6s linear infinite;
}
@keyframes ord-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ord-spin { animation-duration: 1.4s; }
}

/* ---- modal แจ้งเตือน "สินค้ามีปัญหาชั่วคราว" (ใช้โครง .acc-modal ร่วมกัน) ---- */
a.acc-modal-x { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.acc-modal-alert { max-width: 440px; }
.acc-alert-msg { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--text); }
.acc-alert-foot { display: flex; justify-content: flex-end; margin-top: 20px; }
.acc-alert-foot .ord-submit { text-decoration: none; }
.ord-confirm {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 16px; padding: 14px; border-radius: 12px;
  background: var(--good); color: #fff; font-size: 14px; font-weight: 700;
}
.ord-confirm:hover { filter: brightness(1.06); color: #fff; }
.ord-note { margin: 8px 0 0; font-size: 11.5px; color: var(--mut); text-align: center; line-height: 1.6; }

.ord-col { display: flex; flex-direction: column; gap: 14px; }
.ord-side { display: flex; flex-direction: column; gap: 14px; }

/* ---------- dropdown หมวดหมู่ที่มีโลโก้ ---------- */
.cat-dd { position: relative; }
.cat-dd-btn {
  width: 100%; display: flex; align-items: center; gap: 11px;
  background: var(--inputbg); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; color: var(--text); font-family: inherit; font-size: 13.5px; text-align: left;
}
.cat-dd-btn:hover, .cat-dd.is-open .cat-dd-btn { border-color: var(--accent); }
.cat-dd-ico { position: relative; width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
.cat-dd-ico img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 24px; height: 24px; object-fit: contain; }
.cat-dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-dd-label b { font-weight: 400; color: var(--mut); font-size: 12px; margin-left: 6px; }
.cat-dd-caret { color: var(--mut); font-size: 11px; flex: none; }

/* ปิด JS = แผงแสดงตลอด (ยังเลือกหมวดได้) / เปิด JS = ยุบแล้วกดเปิด */
.cat-dd-menu {
  margin-top: 8px; max-height: 320px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.cat-dd.is-js .cat-dd-menu { display: none; }
.cat-dd.is-js.is-open .cat-dd-menu {
  display: block; position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  z-index: 40; box-shadow: var(--shadow);
}
.cat-dd-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 13px;
}
.cat-dd-item:last-child { border-bottom: 0; }
.cat-dd-item:hover { background: var(--chipbg); color: var(--text); }
.cat-dd-item.is-active { background: var(--accsoft); color: var(--accent-ink); font-weight: 600; }
.cat-dd-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-dd-n { font-family: var(--font-num); font-size: 11.5px; color: var(--mut); font-weight: 700; }
.cat-dd-item.is-active .cat-dd-n { color: var(--accent-ink); }

/* ---------- สวิตช์เปิด/ปิดทยอยส่ง ---------- */
.switch {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  background: var(--card2); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; margin-bottom: 18px;
}
.switch:hover { border-color: var(--accent); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 40px; height: 23px; flex: none; border-radius: 99px;
  background: var(--chipbg); border: 1px solid var(--line); position: relative;
  transition: background-color .2s ease, border-color .2s ease;
}
.switch-track i {
  position: absolute; left: 2px; top: 2px; width: 17px; height: 17px; border-radius: 99px;
  background: var(--mut); transition: transform .2s ease, background-color .2s ease;
}
.switch input:checked + .switch-track { background: var(--accsoft); border-color: var(--accent); }
.switch input:checked + .switch-track i { transform: translateX(17px); background: var(--accent); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-txt b { display: block; font-size: 13px; font-weight: 600; }
.switch-txt small { display: block; font-size: 11.5px; color: var(--mut); line-height: 1.6; margin-top: 2px; }

/* ---------- ข้อความแจ้งผลตอนกดสั่งซื้อ ---------- */
.ord-alert {
  display: flex; align-items: center; gap: 9px; margin-bottom: 16px;
  border-radius: 12px; padding: 12px 15px; font-size: 13px; line-height: 1.6;
}
.ord-alert svg { flex: none; }
.ord-alert.is-ok  { background: var(--goodsoft); border: 1px solid var(--good); color: var(--text); }
.ord-alert.is-err { background: var(--badsoft);  border: 1px solid var(--bad);  color: var(--text); }
.ord-err { margin: 0 0 16px; font-size: 12px; color: var(--bad-ink); font-weight: 600; }
.ord-next { margin-top: 16px; text-align: center; }
.ord-next p { margin: 0 0 10px; font-size: 12.5px; color: var(--mut); line-height: 1.7; }

/* ---------- แถวเลือกหมวดหมู่ (โลโก้ + select) ---------- */
.cat-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cat-row .ord-select { flex: 1; min-width: 200px; margin-bottom: 0; }
.cat-now {
  position: relative; width: 44px; height: 44px; flex: none;
  display: grid; place-items: center; border-radius: 12px;
  background: var(--card2); border: 1px solid var(--line); overflow: hidden;
}
.cat-now img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 26px; height: 26px; object-fit: contain; }

/* ---------- รายการบริการที่ค้นหาได้เรียลไทม์ ---------- */
.svc-list {
  max-height: 340px; overflow-y: auto; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--inputbg);
}
.svc-opt {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 12.5px;
}
.svc-opt:last-child { border-bottom: 0; }
.svc-opt:hover { background: var(--chipbg); color: var(--text); }
.svc-opt.is-active { background: var(--accsoft); }
.svc-opt-id { font-family: var(--font-num); font-size: 11px; font-weight: 700; color: var(--mut-ink); }
.svc-opt-name { min-width: 0; line-height: 1.45; overflow-wrap: anywhere; }
.svc-opt-rate { font-family: var(--font-num); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
/* ไฮไลท์คำที่ตรงกับที่พิมพ์ — ต้องอ่านออกทั้งธีมสว่างและมืด จึงคุมสีตัวอักษรเอง */
.svc-opt mark { background: var(--warnsoft); color: var(--text); border-radius: 3px; padding: 0 1px; }
.svc-none { color: var(--warn-ink); }

/* *** attribute hidden ต้องชนะกฎ display ที่เราเขียนเอง ***
   .svc-opt ตั้ง display:grid และ .svc-more ตั้ง display:flex ซึ่ง specificity สูงกว่ากฎ
   [hidden]{display:none} ของ UA stylesheet — ถ้าไม่มีบรรทัดนี้ ตัวกรองจะสั่ง o.hidden = true
   แล้วรายการยังโผล่อยู่เหมือนเดิม (วัดจริงก่อนแก้: .svc-opt[hidden] ได้ display:"grid" สูง 583px)
   จำกัดขอบเขตไว้เฉพาะชิ้นส่วนของรายการบริการ ไม่ไปยุ่งกับ [hidden] ทั้งเว็บ */
.svc-opt[hidden],
.svc-more[hidden],
.svc-sentinel[hidden] { display: none !important; }

/* ---------- แถบสถานะ/ปุ่มโหลดบริการเพิ่ม ---------- */
/* ควรอยู่ "นอก" .svc-list เพราะ role="listbox" รับลูกได้เฉพาะ option
   แต่สไตล์ชุดนี้ใช้ได้ทั้งสองแบบ (ตอนนี้ view ยังวางไว้ในลิสต์)
   ซ่อนไว้ตอนแรกด้วย attribute hidden — ปิด JS ไว้จะไม่เห็นปุ่มที่กดแล้วไม่เกิดอะไรขึ้น */
.svc-more {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--mut); text-align: center; line-height: 1.6;
}
.svc-more-txt { min-width: 0; overflow-wrap: anywhere; }
.svc-more-btn {
  flex: none; border: 1px solid var(--accent); background: var(--accsoft); color: var(--accent-ink);
  border-radius: 9px; padding: 7px 15px; font: inherit; font-weight: 600; cursor: pointer;
}
.svc-more-btn:hover { filter: brightness(1.05); }
.svc-more-btn:disabled { opacity: .55; cursor: default; }
.svc-more-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* ตัวจับท้ายรายการที่ JS สร้างขึ้น — สูง 1px หักด้วย margin ติดลบ = ไม่กระทบเลย์เอาต์ */
.svc-sentinel { display: block; }
@media (max-width: 620px) {
  .svc-more-btn { min-height: 44px; }   /* เป้ากดขั้นต่ำบนมือถือ */
}
/* คำอธิบายบริการจากผู้ให้บริการ
   white-space: pre-line = คงการขึ้นบรรทัดจากข้อมูลไว้ แต่ยุบช่องว่างซ้อนในบรรทัดเดียวกันให้เอง
   ใช้แทนการใส่ <br> เพราะฝั่ง PHP หนีอักขระด้วย h() หมดแล้ว (ข้อความจากภายนอก เชื่อไม่ได้)
   วิธีนี้จึงได้บรรทัดสวยเหมือนต้นฉบับโดยไม่มีแท็กหลุดออกไปแม้แต่ตัวเดียว */
.ord-desc { margin: 0 0 12px; font-size: 12.5px; color: var(--mut); line-height: 1.75; overflow-wrap: anywhere; white-space: pre-line; }
.ord-desc.is-empty { font-style: italic; }

/* กล่องพับ "ดูต้นฉบับภาษาอังกฤษ" — ใช้ <details>/<summary> จึงทำงานได้แม้ปิด JS
   *** ต้องจำกัดความสูงเสมอ *** คำอธิบายยาวสุดในฐาน 5,024 ตัวอักษร
   ถ้าปล่อยยาวเต็ม การ์ดฝั่งขวาจะยืดจาก 929px เป็น 4,003px แล้วดันหน้าเสียทรง
   จึงให้กล่องเลื่อนในตัวเองแทนที่จะดันความสูงของการ์ด */
.ord-src { margin: 0 0 12px; }
.ord-src-sum {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; list-style: none;
  font-size: 12px; color: var(--accent-ink);
  padding: 6px 0; user-select: none;
}
.ord-src-sum::-webkit-details-marker { display: none; }
.ord-src-sum::before {
  content: '▸'; font-size: 10px; line-height: 1;
  transition: transform .15s ease;
}
.ord-src[open] > .ord-src-sum::before { transform: rotate(90deg); }
.ord-src-sum:hover { text-decoration: underline; }
.ord-src-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  padding: 1px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-ink);
}
.ord-src-txt {
  margin: 4px 0 0;
  font-size: 12px; line-height: 1.7; color: var(--mut);
  white-space: pre-line;              /* คงบรรทัดเหมือน .ord-desc (ไม่ใช้ <br>) */
  overflow-wrap: anywhere;
  max-height: 260px; overflow-y: auto;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
@media (max-width: 640px) { .ord-src-txt { max-height: 200px; } }

/* ---------- เลือกหมวดหมู่ด้วยภาพ ---------- */
/* ใช้ปุ่มรูปแทน select เพราะ dropdown ของเบราว์เซอร์ใส่รูปไม่ได้ */
.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.cat-pick-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
  border: 1px solid var(--line); background: var(--card2); color: var(--text);
  border-radius: 13px; padding: 12px 8px; font-size: 11.5px; font-weight: 600;
  transition: border-color .18s ease, background-color .18s ease;
}
.cat-pick-item:hover { border-color: var(--accent); color: var(--text); }
.cat-pick-item.is-active { border-color: var(--accent); background: var(--accsoft); color: var(--accent-ink); }
.cat-pick-ico { position: relative; width: 30px; height: 30px; display: grid; place-items: center; }
.cat-pick-ico img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 26px; height: 26px; object-fit: contain; }
.cat-pick-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.35; overflow-wrap: anywhere;
}
.cat-pick-n { font-family: var(--font-num); font-size: 10.5px; color: var(--mut); font-weight: 700; }
.cat-pick-item.is-active .cat-pick-n { color: var(--accent-ink); }

/* ---------- ค้นหาบริการในฟอร์มสั่งซื้อ ---------- */
.ord-find {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  background: var(--inputbg); border: 1px solid var(--line); border-radius: 12px; padding: 4px 5px 4px 14px;
}
.ord-find:focus-within { border-color: var(--accent); }
.ord-find svg { flex: none; }
.ord-find input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  color: var(--text); font-family: inherit; font-size: 13.5px; padding: 9px 0;
}
.ord-find button {
  flex: none; border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  padding: 10px 18px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
}
.ord-find button:hover { filter: brightness(1.08); }
.ord-mini {
  margin-top: 10px; border: 1px solid var(--accent); background: var(--accsoft); color: var(--accent-ink);
  padding: 9px 18px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
}
.ord-area { min-height: 110px; resize: vertical; line-height: 1.6; }
.ord-label .req { color: var(--bad-ink); font-style: normal; margin-left: 2px; }
.ord-input.is-bad { border-color: var(--bad); }
.ord-type {
  display: flex; align-items: center; gap: 8px; margin: 0 0 16px;
  background: var(--infosoft); border: 1px solid var(--info); border-radius: 12px;
  padding: 10px 14px; font-size: 12.5px; line-height: 1.6;
}
.ord-type svg { flex: none; }
.ord-empty { margin: 0; color: var(--mut); font-size: 13px; line-height: 1.7; }
.ord-picked { font-size: 13px; font-weight: 600; line-height: 1.5; margin-bottom: 12px; overflow-wrap: anywhere; }
.ord-kv { display: grid; gap: 8px; font-size: 12.5px; }
.ord-kv > div { display: flex; justify-content: space-between; gap: 10px; }
.ord-kv span { color: var(--mut); }
.ord-kv b { font-family: var(--font-num); }
.ord-sum {
  margin-top: 14px; display: flex; justify-content: space-between; align-items: center;
  background: var(--chipbg); border-radius: 12px; padding: 12px 14px; font-size: 12.5px;
}
.ord-sum b { font-family: var(--font-num); font-size: 16px; color: var(--accent-ink); }
.ord-tips { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--mut); line-height: 1.85; }
.ord-info {
  background: var(--infosoft); border: 1px solid var(--info); border-radius: 18px;
  padding: 16px 20px; display: flex; gap: 12px; align-items: center;
}
.ord-info p { margin: 0; font-size: 12px; color: var(--text); line-height: 1.6; }
.ord-info svg { flex: none; }

/* =====================================================================
   หน้าเมนูสายบริการ /services
   ===================================================================== */
.lines-head { text-align: center; padding: 46px 0 6px; }
.lines-head h1 { margin: 0 0 12px; font-size: clamp(28px, 4vw, 40px); font-weight: 700; line-height: 1.25; }
.lines-head p { margin: 0 auto; max-width: 660px; color: var(--mut); font-size: 15px; line-height: 1.75; text-wrap: pretty; }
.lines-head strong { color: var(--text); font-family: var(--font-num); }
.lines-grid { padding-top: 26px; }
.cat.is-soon { cursor: default; filter: saturate(.5); opacity: .78; }
.cat.is-soon:hover { transform: none; }
.lines-note {
  display: flex; gap: 12px; align-items: center; margin-top: 28px;
  background: var(--infosoft); border: 1px solid var(--info); border-radius: 18px; padding: 16px 20px;
}
.lines-note p { margin: 0; font-size: 13px; color: var(--text); line-height: 1.7; }
.lines-note svg { flex: none; }

@media (max-width: 1000px) {
  .ord-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  /* เมนูซ้ายกินพื้นที่เกินครึ่งจอ จึงเปลี่ยนเป็นแผงเลื่อนเข้ามาเมื่อกดปุ่ม */
  .side {
    position: fixed; left: 0; top: 0; z-index: 120; height: 100dvh;
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow);
  }
  .side.is-open { transform: none; }
  .topbar-burger { display: grid; }
  .topbar { padding: 14px 0; }
  .topbar-inner { padding: 0 18px; }
  .panel-content { padding: 20px 18px 36px; }
  .side-backdrop {
    position: fixed; inset: 0; z-index: 110; background: rgba(8, 8, 20, .5); border: 0;
  }
}
@media (max-width: 640px) {
  .pf-search button { min-height: 44px; }
  .ord-submit, .ord-confirm { width: 100%; }
  .ord-foot { flex-direction: column; align-items: stretch; }

  /* มือถือ: เลิกใช้ตาราง 6 คอลัมน์ เปลี่ยนเป็นการ์ดต่อแถวแทน
     ตารางต้องกว้าง 840px ถึงจะอ่านได้ ซึ่งดันให้ทั้งหน้าเลื่อนซ้ายขวา
     และการเลื่อนตารางในกล่องบนจอสัมผัสก็ชนกับการเลื่อนหน้าอยู่ดี */
  .tbl { min-width: 0; }
  .tbl-wrap { overflow-x: visible; }
  .tr.th { display: none; }
  .tr {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px; padding: 14px 16px;
  }
  .td-name { order: -1; grid-column: 1 / -1; }
  .td-title { white-space: normal; overflow: visible; }
  .td-id { justify-self: start; }
  .td-price { justify-self: end; font-size: 15px; }
  .td-mut { font-size: 11.5px; }
  .td-buy { grid-column: 1 / -1; min-height: 42px; display: grid; place-items: center; }
}

/* =====================================================================
   หน้าเข้าสู่ระบบ / สมัครสมาชิก
   ===================================================================== */
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-main {
  display: flex; flex-direction: column; justify-content: center;
  max-width: 460px; width: 100%; margin-inline: auto; padding: 40px 28px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; color: inherit; }
.auth-h1 { margin: 0 0 8px; font-size: clamp(24px, 3.4vw, 30px); font-weight: 700; }
.auth-lead { margin: 0 0 26px; color: var(--mut); font-size: 14px; line-height: 1.7; }
.auth-form .ord-label { margin-top: 14px; }
.auth-form .ord-label:first-of-type { margin-top: 0; }
.auth-submit {
  width: 100%; margin-top: 22px; border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  padding: 14px; border-radius: 12px; font-size: 14.5px; font-weight: 700; box-shadow: var(--glow);
}
.auth-submit:hover { filter: brightness(1.08); }
/* เส้นคั่น "หรือ" + ปุ่ม Google (โชว์เฉพาะเมื่อ GoogleAuth::enabled()) */
.auth-or {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 0;
  color: var(--mut); font-size: 12px;
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-google {
  width: 100%; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
}
.auth-google:hover { border-color: var(--accent); color: var(--text); }
.auth-google svg { flex: none; }
/* ปุ่ม LINE — เขียวแบรนด์ LINE (#06C755) ตัวหนังสือขาว ทั้งสองธีม */
.auth-line {
  width: 100%; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid #06C755; background: #06C755; color: #fff;
  padding: 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
}
.auth-line:hover { filter: brightness(1.05); color: #fff; }
.auth-line svg { flex: none; }
.auth-alt { margin: 22px 0 0; text-align: center; font-size: 13.5px; color: var(--mut); }
.auth-note { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--mut); line-height: 1.7; }
.auth-foot { margin: 30px 0 0; font-size: 12.5px; }

.auth-aside {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; display: grid; place-items: center; padding: 40px; position: relative; overflow: hidden;
}
.auth-aside-in { max-width: 380px; position: relative; }
.auth-aside h2 { margin: 0 0 12px; font-size: 26px; font-weight: 700; line-height: 1.35; }
.auth-aside p { margin: 0 0 24px; font-size: 14px; line-height: 1.8; opacity: .9; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.auth-points svg { flex: none; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-main { padding: 32px 20px; min-height: 100vh; }
}

/* =====================================================================
   หน้า error (404 / 500)
   ===================================================================== */
.err { min-height: 72vh; display: grid; place-content: center; text-align: center; gap: 6px; }
.err-code { font-size: clamp(56px, 12vw, 88px); line-height: 1; color: var(--accent-ink); }
.err-title { margin: 10px 0 6px; font-size: clamp(20px, 3vw, 26px); font-weight: 700; }
.err-msg { margin: 0 0 26px; color: var(--mut); font-size: 14.5px; line-height: 1.7; }
.err-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ข้อความไทยยาว ๆ ไม่ให้ดันจนล้นจอ */
.slide-title, .cat-name, .pop-name, .web-name, .row-name, .foot-about, .hero-lead, .svc-name {
  overflow-wrap: anywhere;
}

/* =====================================================================
   สายโปรแกรมออโต้ — รายละเอียด (รูป + เลือกแพ็กเกจ + ทดลอง) และ "โปรแกรมของฉัน"
   ===================================================================== */
/* หัวการ์ดรายละเอียด: รูป + ชื่อ */
.prog-head { display: flex; gap: 14px; align-items: flex-start; }
.prog-thumb {
  position: relative; width: 72px; height: 72px; border-radius: 14px; flex: none;
  display: grid; place-items: center; overflow: hidden;
}
.prog-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* เนื้อหา p_desc (HTML ที่ผ่าน sanitize) — จัดระยะให้อ่านง่าย */
.prog-desc { font-size: 13.5px; line-height: 1.75; color: var(--text); overflow-wrap: anywhere; }
.prog-desc > :first-child { margin-top: 0; }
.prog-desc > :last-child { margin-bottom: 0; }
.prog-desc p { margin: 0 0 10px; }
.prog-desc h2, .prog-desc h3, .prog-desc h4 { margin: 16px 0 8px; line-height: 1.35; font-weight: 700; }
.prog-desc h2 { font-size: 17px; } .prog-desc h3 { font-size: 15px; } .prog-desc h4 { font-size: 13.5px; }
.prog-desc ul, .prog-desc ol { margin: 0 0 10px; padding-left: 22px; }
.prog-desc li { margin: 3px 0; }
.prog-desc a { color: var(--accent-ink); text-decoration: underline; }
.prog-desc img { max-width: 100%; height: auto; border-radius: 10px; margin: 6px 0; }
.prog-desc hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ตัวเลือกแพ็กเกจ (tier) */
.tier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.tier { position: relative; display: block; cursor: pointer; }
.tier input { position: absolute; opacity: 0; width: 0; height: 0; }
.tier-body {
  display: flex; flex-direction: column; gap: 3px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 11px; background: var(--card);
  transition: border-color .12s, background .12s;
}
.tier:hover .tier-body { border-color: var(--accent2); }
.tier.is-on .tier-body, .tier input:checked + .tier-body {
  border-color: var(--accent); background: var(--accsoft);
}
.tier input:focus-visible + .tier-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.tier.is-off { opacity: .5; cursor: not-allowed; }
.tier-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tier-name { font-weight: 700; font-size: 13.5px; }
.tier-off { font-size: 10.5px; font-weight: 700; color: var(--good-ink); background: var(--goodsoft); padding: 1px 6px; border-radius: 999px; }
.tier-used { font-size: 11px; color: var(--mut); }
.tier-price { font-family: var(--font-num); font-size: 15px; font-weight: 700; color: var(--accent-ink); margin-top: 2px; }
.tier-price s { font-size: 11px; }
.tier-sum { margin-top: 12px; }
.prog-wallet { margin-top: 10px; font-size: 12.5px; color: var(--mut); }
.prog-wallet b { color: var(--text); font-family: var(--font-num); }
.ord-short { color: var(--bad-ink); font-weight: 600; }
.prog-trial { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* การ์ดแคตตาล็อกโปรแกรม — รูปโปรแกรม 1:1 เต็มความกว้างการ์ด ข้อมูลอยู่ใต้รูป
   ไอคอน 'auto' อยู่หลังรูปเสมอ = รูปโหลดไม่ได้/ไม่มีรูป เห็นไอคอนแทนโดยไม่ต้องมี JS */
.prog-card .prog-media {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1;
  border-radius: 12px; overflow: hidden; background: var(--accsoft); margin-bottom: 12px;
}
.prog-card .prog-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prog-card .prog-media .prog-media-ico { position: absolute; inset: 0; display: grid; place-items: center; }

/* ตาราง "โปรแกรมของฉัน" */
.tbl-programs { min-width: 1052px; }
.tbl-programs .tr {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) 108px 104px 144px 128px 112px;
}
/* ช่องรูปใหญ่ขึ้นให้เห็นภาพโปรแกรมจริง (base .td-ico 30px ไว้สำหรับตารางอื่น) */
.tbl-programs .td-ico { width: 40px; height: 40px; border-radius: 10px; }
.tbl-programs .td-ico img { width: 100%; height: 100%; object-fit: cover; }
/* ปุ่มต่ออายุ/ดาวน์โหลด — base .td-buy เป็น padding 8px 0 (พึ่งความกว้างคอลัมน์)
   ตารางนี้ข้อความยาว (ต่ออายุ ฿180) จึงต้องมี padding ข้างของตัวเอง + กันตัดบรรทัด */
.tbl-programs .td-buy { padding: 8px 12px; white-space: nowrap; }
.td-key { min-width: 0; }
.prog-key-copy {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  border: 1px solid var(--line); background: var(--chipbg); color: var(--text);
  padding: 5px 9px; border-radius: 8px; font-size: 12px; cursor: pointer;
}
.prog-key-copy:hover { border-color: var(--accent2); color: var(--accent-ink); }
.prog-key-txt { font-family: var(--font-num); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.td-renew, .td-move, .td-dl { min-width: 0; }
.prog-renew-form { margin: 0; }
.td-buy.is-ghost {
  background: transparent; border: 1px solid var(--accent); color: var(--accent-ink);
}
.td-buy.is-ghost:hover { background: var(--accsoft); filter: none; color: var(--accent-ink); }

/* ปุ่ม "ดูรายละเอียด" ของสินค้าที่ของหมด (catalog) — เดิม .td-buy.is-off ไม่มีสไตล์
   จึงเป็นปุ่มไล่เฉดสีสดเหมือนปุ่มซื้อ ทำให้ของหมดกลับดูเด่นกว่าของมี → ปรับเป็นปุ่มรอง(หม่น) */
.td-buy.is-off {
  background: var(--chipbg); color: var(--mut); box-shadow: none; border: 1px solid var(--line);
}
.td-buy.is-off:hover { filter: none; background: var(--chipbg); color: var(--text); }

@media (max-width: 640px) {
  .tbl-programs { min-width: 0; }
  .tbl-programs .tr { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .tbl-programs .td-name { order: -1; grid-column: 1 / -1; }
  .tbl-programs .td-key { grid-column: 1 / -1; }
  .tbl-programs .td-renew, .tbl-programs .td-move, .tbl-programs .td-dl { min-height: 40px; display: flex; align-items: center; }
  .tbl-programs .td-buy { min-height: 40px; }
  .tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =====================================================================
   กล่องยืนยันก่อนสั่งซื้อ (สร้างด้วย app.js — .buy-confirm)
   โครงเดียวกับ .acc-modal ใช้สีจาก tokens.css ล้วน
   z-index 210 = อยู่เหนือ .acc-modal (200) เผื่อซ้อนกัน
   ===================================================================== */
.buy-confirm {
  position: fixed; inset: 0; z-index: 210;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.buy-confirm[hidden] { display: none; }
.buy-confirm-backdrop {
  position: absolute; inset: 0; border: 0; cursor: pointer;
  background: rgba(8, 8, 20, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.buy-confirm-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 24px; outline: none; text-align: center;
}
.buy-confirm-title {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 18px; font-weight: 700; margin: 0 0 10px;
}
.buy-confirm-msg { color: var(--mut); font-size: 14px; line-height: 1.65; margin: 0 0 14px; }
.buy-confirm-amt {
  display: inline-block; margin: 0 auto 18px;
  background: var(--accsoft); color: var(--accent-ink);
  font-family: var(--font-num); font-weight: 700; font-size: 15px;
  padding: 9px 18px; border-radius: 12px;
}
.buy-confirm-amt[hidden] { display: none; }
.buy-confirm-actions { display: flex; gap: 10px; }
.buy-confirm-actions button {
  flex: 1; padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; min-height: 44px;
}
.buy-confirm-cancel { border: 1px solid var(--line); background: var(--card2); color: var(--text); }
.buy-confirm-cancel:hover { border-color: var(--accent); }
.buy-confirm-ok {
  border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; box-shadow: var(--glow);
}
.buy-confirm-ok:hover { filter: brightness(1.08); color: #fff; }

@media (max-width: 640px) {
  /* จอเล็ก: ดันกล่องมาชิดล่าง กดด้วยนิ้วสะดวกกว่ากลางจอ */
  .buy-confirm { padding: 12px; align-items: flex-end; }
  .buy-confirm-dialog { max-width: 100%; }
}
