/* โครงสร้างและคอมโพเนนต์ — ไม่ใส่สีตายตัว ใช้ตัวแปรจากไฟล์ theme.css ของธีมที่เลือก */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.ic { width: 20px; height: 20px; flex: none; }
.right { text-align: right; } .center { text-align: center; }
.mt { margin-top: 20px; } .mb { margin-bottom: 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ---------- ปุ่ม ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border: 1px solid transparent; border-radius: 10px; background: var(--primary); color: var(--primary-ink); font: 600 15px var(--font); cursor: pointer; text-decoration: none; transition: transform .12s, filter .12s, box-shadow .12s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; box-shadow: 0 6px 18px var(--primary-soft); }
.btn-sm { padding: 7px 16px; font-size: 14px; }
.btn-lg { padding: 14px 30px; font-size: 17px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); box-shadow: none; }
.btn-danger { background: transparent; color: var(--down); border-color: var(--down); }
.btn-ok { background: var(--up); color: #fff; }
.btn-block { width: 100%; }
.link-muted { color: var(--muted); font-size: 14px; }

/* ---------- ฟอร์ม ---------- */
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 11px 14px; background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; font: 15px var(--font); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { min-height: 110px; resize: vertical; }
input[type=file] { color: var(--muted); font-size: 14px; }
.field { margin-bottom: 16px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { margin-top: 5px; accent-color: var(--primary); }

/* ---------- การ์ด / ตาราง / badge ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3 { font-size: 17px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--primary-soft); }
.badge { display: inline-block; padding: 2px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--surface2); color: var(--muted); }
.b-paid { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }
.b-pending { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.b-slip_sent { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.b-rejected, .b-cancelled, .b-expired { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); }
.b-monthly { background: var(--primary-soft); color: var(--primary); }
.b-lifetime { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: 15px; }
.alert-ok { background: color-mix(in srgb, var(--up) 12%, transparent); border-color: color-mix(in srgb, var(--up) 40%, transparent); color: var(--up); }
.alert-err { background: color-mix(in srgb, var(--down) 12%, transparent); border-color: color-mix(in srgb, var(--down) 40%, transparent); color: var(--down); }
.alert-warn { background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.empty { text-align: center; padding: 38px 10px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14px; } .kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.prose { max-width: 760px; } .prose h3 { margin-top: 1.6em; } .prose ul { padding-left: 1.2em; }
.copybtn { cursor: pointer; background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 2px 10px; font: 13px var(--font); }

/* ---------- เว็บหน้าบ้าน ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand-mark, .brand-img { width: 30px; height: 30px; object-fit: contain; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: var(--muted); font-size: 15px; } .nav a:not(.btn):hover, .nav a.on { color: var(--text); text-decoration: none; }
.burger { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 7px; cursor: pointer; }

.hero { position: relative; overflow: hidden; padding: 84px 0 96px; background: var(--hero-glow), linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 48px, linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 48px 100%; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border: 1px solid var(--border); border-radius: 99px; font-size: 13px; color: var(--muted); background: var(--surface); margin-bottom: 20px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 700; margin-bottom: 18px; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 540px; margin-bottom: 30px; }
.chart-card { background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border); border-radius: 20px; padding: 18px 18px 8px; box-shadow: var(--shadow); }
.chart-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.chart-top b { color: var(--text); font-family: var(--mono); }
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 0 12px; }
.chip { font-size: 12.5px; padding: 3px 12px; border-radius: 99px; background: var(--surface2); color: var(--muted); border: 1px solid var(--border); font-family: var(--mono); }

.trust { background: var(--bg2); border-block: 1px solid var(--border); }
.trust .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 22px 0; text-align: center; }
.trust b { display: block; color: var(--primary); font-size: 17px; } .trust span { font-size: 13.5px; color: var(--muted); }

.section { padding: 76px 0; } .section.alt { background: var(--bg2); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); } .section-head p { color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { padding: 26px; } .feature .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.feature p { color: var(--muted); font-size: 15px; margin: 0; }
.steps { counter-reset: s; } .step { position: relative; padding: 26px; } .step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font: 700 17px var(--mono); margin-bottom: 14px; }
.step p { color: var(--muted); font-size: 15px; margin: 0; }

.pcard { display: flex; flex-direction: column; padding: 0; overflow: hidden; transition: transform .2s, border-color .2s; }
.pcard:hover { transform: translateY(-4px); border-color: var(--primary); }
.pcard .cover { aspect-ratio: 1/1; background: var(--surface2) center/cover; display: grid; place-items: center; color: var(--muted); }
.pcard .body { padding: 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.price-from { font-size: 14px; color: var(--muted); } .price-from b { font-size: 24px; color: var(--primary); font-family: var(--mono); }

.product-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: start; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.gallery img { border-radius: 10px; border: 1px solid var(--border); aspect-ratio: 1/1; object-fit: cover; width: 100%; cursor: zoom-in; }
.video { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.plans { display: grid; gap: 14px; }
.plan { position: relative; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.plan.hot { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 14px 34px var(--primary-soft); }
.plan .price { font: 700 32px var(--mono); margin: 4px 0 2px; } .plan .price small { font: 400 14px var(--font); color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 14px 0 18px; font-size: 14.5px; color: var(--muted); }
.plan li { padding: 4px 0 4px 26px; position: relative; } .plan li::before { content: ''; position: absolute; left: 3px; top: 11px; width: 12px; height: 7px; border-left: 2px solid var(--up); border-bottom: 2px solid var(--up); transform: rotate(-45deg); }
.ribbon { position: absolute; top: -11px; right: 18px; background: var(--primary); color: var(--primary-ink); font-size: 12px; font-weight: 700; padding: 2px 12px; border-radius: 99px; }
.compare td:first-child { color: var(--muted); } .compare .yes { color: var(--up); font-weight: 600; }

.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 500; } .faq p { margin: 12px 0 0; color: var(--muted); }
.risk { display: flex; gap: 14px; align-items: flex-start; padding: 18px 22px; border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); border-radius: var(--radius); font-size: 14.5px; color: var(--muted); }
.auth { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 40px 0; }
.auth .card { width: min(440px, 100%); padding: 32px; } .auth h1 { font-size: 26px; }
.page-title { padding: 44px 0 10px; } .page-title h1 { font-size: 32px; margin: 0; }
.site-main { min-height: 60vh; } .site-main > .wrap { padding-bottom: 70px; }

.foot { background: var(--bg2); border-top: 1px solid var(--border); padding-top: 48px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
.foot h4 { font-size: 15px; } .foot-grid a:not(.btn):not(.brand) { display: block; color: var(--muted); font-size: 14.5px; padding: 3px 0; }
.foot-note { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; margin-top: 30px; border-top: 1px solid var(--border); }

/* ---------- สมาชิก / แอดมิน ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; }
.side-brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 20px; } .tag { font-size: 10.5px; letter-spacing: 1px; padding: 2px 8px; border-radius: 6px; background: var(--primary); color: var(--primary-ink); font-weight: 700; }
.side nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-size: 15px; } .side a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.side a.on { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.pill { margin-left: auto; font-style: normal; font-size: 12px; background: var(--down); color: #fff; border-radius: 99px; padding: 0 8px; font-weight: 600; }
.side-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; } .who { padding: 4px 12px 10px; font-size: 14px; font-weight: 500; } .who small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.app-main { min-width: 0; } .app-top { display: flex; align-items: center; gap: 12px; padding: 22px 32px 0; } .app-top h1 { font-size: 24px; margin: 0; }
.app-body { padding: 20px 32px 60px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; } .stat small { color: var(--muted); font-size: 13.5px; display: block; } .stat b { display: block; font: 700 28px var(--mono); margin-top: 4px; }
.stat.hl b { color: var(--primary); } .stat.warn b { color: var(--warn); }
.cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; font-size: 12px; color: var(--muted); }
.bar-col i { width: 100%; max-width: 54px; border-radius: 8px 8px 0 0; background: linear-gradient(var(--primary), color-mix(in srgb, var(--primary) 40%, transparent)); min-height: 3px; }
.bar-col span { font: 500 11.5px var(--mono); color: var(--text); }
.lic { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; } .lic:last-child { border: 0; }
.slip-img { max-width: 360px; width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { position: relative; padding: 0 0 18px 28px; color: var(--muted); font-size: 14.5px; } .timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg); } .timeline li::after { content: ''; position: absolute; left: 9px; top: 20px; bottom: 0; width: 1px; background: var(--border); } .timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--text); } .timeline li.done::before { background: var(--up); border-color: var(--up); }
.bank { padding: 18px 20px; border-radius: 12px; background: var(--primary-soft); border: 1px dashed var(--primary); } .bank b.mono { font-size: 22px; letter-spacing: 1px; }
.lesson-list a { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 10px; color: var(--text); } .lesson-list a:hover, .lesson-list a.on { background: var(--primary-soft); text-decoration: none; } .lesson-list a.on { color: var(--primary); }
.lesson-list .n { font: 600 13px var(--mono); color: var(--muted); width: 22px; }

@media (max-width: 960px) {
  .hero-grid, .product-grid, .cols { grid-template-columns: 1fr; } .hero { padding: 52px 0 60px; }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; } .trust .wrap { grid-template-columns: 1fr 1fr; }
  .app { grid-template-columns: 1fr; } .side { position: fixed; z-index: 80; width: 270px; left: -290px; transition: left .25s; box-shadow: var(--shadow); } .side.open { left: 0; }
  .app-top .burger { display: block; } .app-top, .app-body { padding-inline: 16px; }
}
@media (max-width: 760px) {
  .burger { display: block; } .topbar .nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--bg2); flex-direction: column; align-items: stretch; padding: 16px; gap: 14px; border-bottom: 1px solid var(--border); } .topbar .nav.open { display: flex; }
  .grid3, .grid4, .grid2, .foot-grid { grid-template-columns: 1fr; } .section { padding: 52px 0; } .kv { grid-template-columns: 110px 1fr; }
}
@media print { .side, .app-top .burger, .btn, .noprint { display: none !important; } .app { display: block; } body { background: #fff; color: #000; } .card { border-color: #ccc; } }

/* รูปสินค้า 1:1 + ปุ่มแชท LINE */
.sq-img { aspect-ratio: 1/1; object-fit: cover; width: 100%; max-width: 560px; border-radius: var(--radius); border: 1px solid var(--border); }
.line-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 99px; background: var(--line, #06c755); color: #fff; font: 600 15px var(--font); box-shadow: 0 8px 24px rgba(0,0,0,.35); text-decoration: none; transition: transform .15s; }
.line-fab:hover { transform: translateY(-2px); text-decoration: none; color: #fff; }
.line-fab svg { width: 22px; height: 22px; }
@media (max-width: 760px) { .line-fab span { display: none; } .line-fab { padding: 14px; } }
@media print { .line-fab { display: none !important; } }

/* ผลงาน */
.up { color: var(--up); } .down { color: var(--down); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; align-items: start; }
.res h3 { font-size: 17px; margin-bottom: 6px; } .res .big { font: 700 32px var(--mono); line-height: 1.2; margin: 4px 0 6px; }
.metrics { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); } .metrics b { color: var(--text); font-family: var(--mono); }
.res-img { width: 100%; margin-top: 12px; border-radius: 10px; border: 1px solid var(--border); aspect-ratio: 1/1; object-fit: contain; background: var(--surface2); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; } .tab { padding: 8px 18px; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); font-size: 14.5px; }
.tab:hover { text-decoration: none; color: var(--text); } .tab.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.rchart { width: 100%; height: auto; display: block; }
.stat b.up { color: var(--up); } .stat b.down { color: var(--down); }

/* มือถือ / แท็บเล็ต */
@media (max-width: 960px) { .cols { grid-template-columns: 1fr !important; } .app-top h1 { font-size: 21px; } }
@media (max-width: 760px) {
  .cols, .grid2 { grid-template-columns: 1fr !important; }
  .wrap { width: calc(100% - 28px); }
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 44px; } .btn-sm { min-height: 38px; }
  .card { padding: 16px; } .app-body { padding: 12px 14px 90px; } .app-top { padding: 16px 14px 0; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 14px; } .stat b { font-size: 22px; }
  .page-title { padding: 28px 0 6px; } .page-title h1 { font-size: 26px; }
  .row > .btn { flex: 1 1 auto; }
  .plan .price { font-size: 28px; }
  .res-grid { grid-template-columns: minmax(0, 1fr); }
  .side { width: 82vw; max-width: 300px; left: -100%; } .side.open { left: 0; }
  body.nav-open { overflow: hidden; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .tab { white-space: nowrap; }
  .bars { gap: 8px; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody { display: block; }
  table.stack tr { display: block; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 6px 14px; background: var(--surface2); }
  table.stack tbody tr:hover { background: var(--surface2); }
  table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 0; padding: 7px 0; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  table.stack td[data-label=""]::before { content: none; } table.stack td[data-label=""] { justify-content: flex-end; }
  table.stack td:empty { display: none; }
  .table-wrap { margin: 0; }
  .kv { grid-template-columns: 105px 1fr; }
}
@media (min-width: 761px) and (max-width: 1100px) { .app { grid-template-columns: 220px 1fr; } .app-body { padding-inline: 22px; } }

.res, .res-grid > * { min-width: 0; overflow-wrap: anywhere; }

/* ---------- หน้าเลือกธีม (แอดมิน) ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.theme-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.theme-prev { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.theme-swatch { padding: 14px; display: flex; flex-direction: column; justify-content: space-between; }
.theme-swatch > div { border: 1px solid; border-radius: 8px; padding: 10px; display: grid; gap: 6px; }
.theme-swatch > div i { display: block; height: 8px; border-radius: 4px; }
.theme-swatch > div i:nth-child(1) { width: 40%; height: 12px; }
.theme-swatch > div i:nth-child(2) { width: 85%; }
.theme-swatch > div i:nth-child(3) { width: 60%; }
.theme-swatch p { margin: 0; display: flex; gap: 6px; }
.theme-swatch p b { width: 22px; height: 22px; border-radius: 50%; display: block; }

/* ---------- แก้มือถือ: กันล้นขอบ / เมนูข้างไม่โดนแถบเบราว์เซอร์บัง ---------- */
input, select, textarea, button { max-width: 100%; }
.grid2 > *, .row > *, .field, .cols > *, .stats > * { min-width: 0; }
input[type=file] { width: 100%; }
input[type=tel], input[type=time], input[type=month] { width: 100%; padding: 11px 14px; background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; font: 15px var(--font); }
@media (max-width: 760px) {
  .side { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .side-foot { padding-bottom: 28px; }
  .auth { min-height: 0; padding: 24px 0; place-items: stretch; }
  .auth .card { width: 100%; padding: 22px 18px; } .auth h1 { font-size: 23px; }
  .plan .btn, .pcard .btn { width: 100%; }
  .row { gap: 10px; }
}

/* แถบสถิติ License: มือถือเลื่อนซ้าย-ขวาได้ ประหยัดพื้นที่ */
@media (max-width: 760px) {
  .lic-stats { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .lic-stats > * { flex: 0 0 132px; scroll-snap-align: start; }
}
/* Google Drive player: cover the pop-out button (top-right) so the Drive link is not opened from the player */
.video-drive .drive-shield { position: absolute; top: 0; right: 0; width: 64px; height: 64px; z-index: 2; background: transparent; }
