/* ฟอนต์ Prompt (SIL Open Font License, ดู fonts/OFL.txt) */
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 300; font-display: swap; src: url('fonts/prompt-light.woff') format('woff'); }
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/prompt-regular.woff') format('woff'); }
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/prompt-medium.woff') format('woff'); }
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/prompt-semibold.woff') format('woff'); }
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/prompt-bold.woff') format('woff'); }

:root {
  --bg: #0B0910;
  --bg-2: #110D18;
  --card: #16111F;
  --card-2: #1B1330;
  --line: #2E2440;
  --line-soft: #241C33;
  --line-strong: #433558;
  --text: #EEF1F6;
  --text-2: #C0B6D2;
  --text-3: #A79CBA;
  --accent: #B98CFF;
  --accent-hover: #E3D2FF;
  --accent-soft: #21173A;
  --accent-line: #4B3478;
  --gold: #D9B872;
  --gold-soft: #1E1810;
  --gold-line: #5C4A2C;
  --danger: #FF9EB0;
  --serif: 'Prompt', system-ui, sans-serif;
  --sans: 'Prompt', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.serif { font-family: var(--serif); }
.gold { color: var(--gold); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--serif); margin: 0; line-height: 1.2; }
h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 700; }
h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 600; }
h3 { font-size: 22px; font-weight: 600; }

/* header */
.site-header { border-top: 2px solid var(--gold); border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 22px; }
.brand-logo { display: block; height: var(--logo-h, 50px); width: auto; max-width: 260px; object-fit: contain; }
@media (max-width: 640px) { .brand-logo { height: calc(var(--logo-h, 50px) * .8); max-width: 200px; } }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--gold); display: grid; place-items: center; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-left: auto; font-size: 15px; }
.nav a.plain { color: var(--text); text-decoration: none; }

/* buttons */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); text-decoration: none; font-weight: 500; cursor: pointer; }
.btn:hover { color: var(--text); border-color: var(--text-3); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--bg); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 600; }
.btn-gold:hover { background: #E8D5A8; color: var(--bg); }
.btn-gold-outline { border-color: var(--gold); color: var(--gold); font-weight: 600; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); }
.chip-gold { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.tier { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--bg); }
.tier-BRONZE { background: #D49A6A; } .tier-SILVER { background: #D3D7E0; } .tier-GOLD { background: var(--gold); }
.tier-PLATINUM { background: #BFE3F2; } .tier-DIAMOND { background: var(--accent); }
.tc-BRONZE { color: #D49A6A; } .tc-SILVER { color: #D3D7E0; } .tc-GOLD { color: var(--gold); } .tc-PLATINUM { color: #BFE3F2; } .tc-DIAMOND { color: var(--accent); }

/* cards & forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.card-gold { border-color: var(--gold-line); }
.card-hero { background: var(--card-2); border-color: var(--gold); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.input { height: 48px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: 16px; padding: 0 14px; width: 100%; }
.input:focus { border-color: var(--accent); outline: none; }
.input-error { border-color: var(--danger); }
.error { color: var(--danger); font-size: 14px; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold); font-size: 14px; }
.notice-purple { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--gold); flex: none; }
dl.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
dl.kv dt { color: var(--text-3); }
dl.kv dd { margin: 0; text-align: right; word-break: break-all; }

/* sections */
.section { padding-top: 56px; padding-bottom: 56px; }
.hero { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
.hero-text { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero-form { flex: 1 1 340px; min-width: 0; }
.grid-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.game-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--text); }
.game-card:hover { border-color: var(--gold-line); color: var(--text); }
.tile { display: grid; place-items: center; aspect-ratio: 1 / 1; border-radius: 12px; color: #fff; font-family: var(--serif); font-weight: 700; font-size: 34px; letter-spacing: 1px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step-num { font-family: var(--serif); font-weight: 700; font-size: 40px; color: var(--gold); line-height: 1; }
.band { background: var(--bg-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.split { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.split > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.split > .side { flex: 1 1 340px; min-width: 0; }
.step-title { display: flex; align-items: center; gap: 12px; }
.step-badge { width: 32px; height: 32px; border-radius: 999px; background: var(--gold); color: var(--bg); display: inline-grid; place-items: center; font-size: 16px; font-family: var(--sans); font-weight: 600; flex: none; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.pack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; min-height: 104px; border-radius: 14px; text-align: left; color: var(--text); cursor: pointer; background: var(--bg); border: 2px solid var(--line); }
.pack[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); }
.pack .price { color: var(--gold); font-weight: 600; font-size: 17px; margin-top: auto; }
.total { font-family: var(--serif); font-weight: 700; font-size: 34px; color: var(--gold); }
.list { border-radius: 16px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--gold); }
.code { font-family: ui-monospace, Menlo, monospace; font-weight: 600; letter-spacing: 1px; color: var(--gold); }
.qr-box { width: 270px; max-width: 100%; margin: 0 auto; padding: 16px; border-radius: 18px; background: #fff; border: 3px solid var(--gold); color: #0B0910; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.qr-head { align-self: stretch; height: 32px; border-radius: 6px; background: #0E3A5C; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; letter-spacing: .5px; }
.narrow { max-width: 480px; margin: 0 auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl th { color: var(--text-3); font-weight: 500; background: var(--card); }
.site-footer { border-top: 1px solid var(--line-soft); margin-top: 40px; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding-top: 28px; padding-bottom: 36px; color: var(--text-3); font-size: 14px; }

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .card { padding: 20px; }
  .nav { margin-left: 0; }
}

/* PHP version extras */
.qr-box svg { width: 230px; height: 230px; display: block; }
.hidden { display: none !important; }
.nav form { margin: 0; }
.chip-btn { border-radius: 999px; min-height: 40px; padding: 0 16px; font-size: 15px; }
.chip-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

/* LINE contact */
:root { --line-green: #06C755; }
.btn-line { background: var(--line-green); border-color: var(--line-green); color: #fff; font-weight: 600; }
.btn-line:hover { background: #05B34C; border-color: #05B34C; color: #fff; }
.btn-line .line-id { opacity: .85; font-weight: 500; }
.line-float { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px 0 16px;
  border-radius: 999px; background: var(--line-green); color: #fff; text-decoration: none; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.line-float:hover { color: #fff; background: #05B34C; }
@media (max-width: 640px) { .line-float { right: 14px; bottom: 14px; min-height: 48px; padding: 0 14px; } .line-float span { display: none; } .site-footer .container { padding-bottom: 80px; } }

/* อัปโหลดสลิป */
.slip-drop{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;padding:22px 16px;border:1.5px dashed var(--gold-line);border-radius:14px;background:var(--bg);color:var(--gold);text-align:center;cursor:pointer}
.slip-drop:hover,.slip-drop:focus-within{background:var(--gold-soft)}
.slip-drop span:not(.dim){color:var(--text,#fff);font-weight:600}
.slip-drop input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}

/* ติ๊กหมวดโค้ดส่วนลด */
.cat-check{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:6px 14px;border:1px solid var(--line);border-radius:999px;background:var(--bg);cursor:pointer;font-size:14px}
.cat-check input{accent-color:var(--gold);width:16px;height:16px}
.cat-check:has(input:checked){border-color:var(--gold-line);background:var(--gold-soft);color:var(--gold)}

/* แบนเนอร์โปรโมชั่นหน้าแรก: จอใหญ่ 2 รูป มือถือ 1 รูป */
.banners { position: relative; padding-top: 28px; }
.hero.hero-tight { padding-top: 36px; }
.banner-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; border-radius: 20px; }
.banner-track::-webkit-scrollbar { display: none; }
.banner-track:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.banner-slide { flex: 0 0 calc((100% - 16px) / 2); scroll-snap-align: start; aspect-ratio: 2 / 1; border-radius: 20px; overflow: hidden; border: 1px solid var(--gold-line); background: var(--bg-2, #15121F); display: block; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
a.banner-slide:hover img { transform: scale(1.03); }
.banner-nav { position: absolute; top: calc(50% + 14px); transform: translateY(-50%); width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--gold-line); background: rgba(10, 8, 16, .75); color: var(--gold); display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); }
.banner-nav.prev { left: 6px; } .banner-nav.prev svg { transform: rotate(180deg); }
.banner-nav.next { right: 6px; }
.banner-nav:hover { background: var(--gold-soft); }
.banner-dots { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.banner-dots button { width: 8px; height: 8px; padding: 0; border-radius: 999px; border: 0; background: var(--line); cursor: pointer; transition: width .2s, background .2s; }
.banner-dots button[aria-current="true"] { width: 24px; background: var(--gold); }
@media (max-width: 640px) {
  .banner-slide { flex-basis: 100%; }
  .banner-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) { .banner-track { scroll-behavior: auto; } .banner-slide img { transition: none; } }

.banner-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.banner-admin-item { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg); }
.banner-admin-item.off img { opacity: .35; }
.banner-admin-item img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; display: block; }

.ref-tiers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.ref-tier { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--gold-line); background: var(--gold-soft); min-width: 140px; }
[data-ref-tiers] .input { min-width: 110px; }

/* ===== หลังร้านแบบ dashboard ===== */
.admin-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 32px; padding-top: 28px; padding-bottom: 80px; align-items: start; }
.admin-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); }
.admin-side-head { display: flex; flex-direction: column; gap: 2px; padding: 0 8px 10px; border-bottom: 1px solid var(--line); }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a, .admin-nav-out { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--text-2); text-decoration: none; font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; text-align: left; }
.admin-nav a:hover, .admin-nav-out:hover { background: rgba(255,255,255,.04); color: var(--text); }
.admin-nav a.active { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-line); }
.admin-nav a span { flex: 1; }
.admin-nav-out { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; padding-top: 10px; }
.admin-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--danger); color: #2A0A12; font-size: 12px; font-weight: 600; }
.admin-title { font-size: 32px; }
.admin-h2 { font-size: 20px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-2); }
.kpi strong { font-size: 26px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.kpi .dim { font-size: 13px; }
.kpi-warn { border-color: rgba(240, 97, 109, .55); }
.kpi-warn strong { color: var(--danger, #F0616D); }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.todo { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.todo strong { font-size: 28px; font-weight: 700; color: var(--text-3); }
.todo.hot { border-color: var(--gold-line); background: var(--gold-soft); }
.todo.hot strong { color: var(--gold); }
.todo:hover { border-color: var(--gold); transform: translateY(-1px); }
.sales-chart { width: 100%; height: auto; display: block; }
.sales-chart .bar { fill: var(--gold); opacity: .85; }
.sales-chart .bar-profit { fill: var(--accent); }
.sales-chart g:hover .bar { opacity: 1; }
.sales-chart .grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
.sales-chart .axis { fill: var(--text-3); font-size: 11px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #f3d28a); border-radius: 999px; }
.status-pill { display: block; font-size: 12px; color: var(--text-3); }
.status-pill.st-SUCCESS { color: var(--accent); }
.status-pill.st-REFUND_PENDING, .status-pill.st-ON_HOLD { color: var(--danger, #F0616D); }
.status-pill.st-AWAITING_PAYMENT, .status-pill.st-PROCESSING, .status-pill.st-PAID { color: var(--gold); }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 16px; }
  .admin-side, .admin-main { min-width: 0; }
  .admin-side { position: static; padding: 8px; border-radius: 14px; }
  .admin-side-head { display: none; }
  .admin-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav a, .admin-nav-out { flex: none; min-height: 40px; padding: 0 12px; white-space: nowrap; }
  .admin-nav-out { margin: 0; border: 0; padding-top: 0; border-radius: 12px; }
  .admin-title { font-size: 26px; }
}

/* ป๊อปอัพแจ้งเตือนหลังร้าน */
.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--gold-line); background: #1c1626; color: var(--text); text-decoration: none; box-shadow: 0 12px 32px rgba(0,0,0,.45); animation: toast-in .25s ease; transition: opacity .35s, transform .35s; }
.toast strong { color: var(--gold); font-weight: 600; }
.toast span { font-size: 14px; color: var(--text-2); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.sound-unlock { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 61; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--gold-line); background: var(--gold); color: #1a1206; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; transition: none; } }

.brand-admin { display: flex; flex-wrap: wrap; gap: 16px; }
.brand-box { flex: 1 1 300px; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.brand-preview { display: grid; place-items: center; min-height: 110px; padding: 16px; border-radius: 12px; border: 1px dashed var(--gold-line); background: #0B0910; }
.brand-preview img { max-width: 100%; object-fit: contain; }

input[type=range] { accent-color: var(--gold); }

.tile-img { overflow: hidden; background: var(--bg); padding: 0; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.prod-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); }
.prod-card.off { opacity: .55; }
.prod-card .tile { width: 72px; font-size: 24px; flex: none; }

.staff-off { opacity: .6; }
.admin-side-head strong { font-family: var(--sans); }

.announce { background: var(--gold); color: #1a1206; text-align: center; padding: 8px 16px; font-size: 14px; font-weight: 500; }

.seo-preview { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; background: #fff; color: #4d5156; font-family: Arial, sans-serif; max-width: 600px; }
.seo-preview strong { color: #1a0dab; font-size: 19px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-preview span:last-child { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.color-pick { width: 48px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; flex: none; }
textarea.input { resize: vertical; min-height: 64px; padding-top: 10px; font: inherit; }

.save-bar { gap: 12px; align-items: center; position: sticky; bottom: 0; z-index: 5; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }

.pay-accs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pay-acc.on { border-color: var(--gold-line); box-shadow: 0 0 0 1px var(--gold-line) inset; }

.slip-info { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); max-width: 560px; }

/* ภาพรวมละเอียด */
.live-strip { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); font-size: 15px; }
.live-strip strong { color: var(--gold); font-size: 18px; }
.pulse { display: inline-block; width: 10px; height: 10px; border-radius: 999px; background: #3DDC84; margin-right: 8px; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: pulse 2s infinite; vertical-align: middle; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,.6); } 70% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
.chg { font-weight: 600; margin-right: 4px; }
.chg.up { color: #3DDC84; }
.chg.down { color: var(--danger); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.range-form .input[type=date] { flex: 1 1 140px; min-width: 0; }

/* เลือกวิธีชำระ (สแกน / เครดิต) */
.paywith { border: 1px solid var(--line, #2a2a33); border-radius: 12px; padding: 10px 14px 12px; margin: 0; min-width: 0; }
.paywith legend { padding: 0 6px; }
.paywith .check { min-height: 36px; align-items: center; font-size: 15px; color: var(--text); }

/* ===== หัวเว็บ: เมนูหลัก (เน้นหน้าที่อยู่) + เครดิต + เมนูบัญชี ===== */
.header-bar { flex-wrap: nowrap !important; gap: 20px !important; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-link { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; transition: color .15s, background .15s; }
.nav-link svg { opacity: .7; }
.nav-link:hover { color: var(--text); background: var(--card); }
.nav-link.active { color: var(--gold); background: var(--gold-soft); font-weight: 600; }
.nav-link.active svg { opacity: 1; }
.nav-link.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -15px; height: 2px; border-radius: 2px; background: var(--gold); }
.nav-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.wallet-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px 0 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text); text-decoration: none; white-space: nowrap; }
.wallet-pill strong { font-weight: 600; }
.wallet-pill:hover, .wallet-pill.active { border-color: var(--gold); color: var(--text); }
.wallet-add { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--gold); color: var(--bg); font-weight: 700; font-size: 18px; line-height: 1; }
.acct { position: relative; }
.acct summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px 0 4px; border-radius: 999px;
  border: 1px solid var(--line-strong); cursor: pointer; white-space: nowrap; user-select: none; }
.acct summary::-webkit-details-marker { display: none; }
.acct summary:hover, .acct[open] summary { border-color: var(--gold); }
.acct-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 700; border: 1px solid var(--gold-line); }
.acct-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.acct-caret { color: var(--text-3); transition: transform .15s; }
.acct[open] .acct-caret { transform: rotate(180deg); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 270px; padding: 8px; border-radius: 16px; border: 1px solid var(--line-strong);
  background: var(--bg-2, var(--card)); box-shadow: 0 18px 40px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 2px; }
.acct-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.acct-stats { display: flex; gap: 18px; margin-top: 8px; font-size: 13px; }
.acct-stats > span { display: flex; flex-direction: column; }
.acct-stats b { font-size: 17px; }
.acct-menu a, .acct-menu button { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border-radius: 10px; border: 0; background: none;
  color: var(--text); text-decoration: none; font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--card); }
.acct-menu svg { color: var(--text-3); }
.acct-out { color: var(--danger) !important; margin-top: 4px; border-top: 1px solid var(--line-soft) !important; border-radius: 0 0 10px 10px !important; }
.acct-out svg { color: var(--danger); }

@media (max-width: 900px) {
  .header-bar { flex-wrap: wrap !important; gap: 10px 12px !important; padding-bottom: 0 !important; }
  .nav-tools { order: 2; }
  .main-nav { order: 3; flex: 1 0 100%; margin: 0 -16px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line-soft); gap: 0; }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-link { flex: 1 0 auto; justify-content: center; border-radius: 0; background: none !important; min-height: 46px; padding: 0 12px; font-size: 14px; }
  .nav-link.active::after { bottom: 0; left: 10px; right: 10px; height: 3px; }
  .acct-name, .acct summary .tier { display: none; }
  .acct summary { padding: 0 8px 0 4px; }
}
@media (max-width: 400px) {
  .nav-link svg { display: none; }
  .wallet-pill { padding-left: 10px; }
}
@media (max-width: 520px) {
  .header-bar .brand-logo { max-width: 128px; height: auto; max-height: calc(var(--logo-h, 50px) * .75); }
  .nav-tools { gap: 6px; }
  .nav-tools .btn-sm { padding: 0 11px; font-size: 14px; min-height: 38px; }
  .wallet-pill { min-height: 38px; }
}

/* ออเดอร์ของฉัน */
.tabs-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll .btn { flex: none; }
.my-order { padding: 14px 16px; }
.my-order-main { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.my-order-main:hover strong { color: var(--gold); }
.my-codes { margin-top: 10px; }
.my-codes summary { cursor: pointer; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.my-codes[open] { display: flex; flex-direction: column; gap: 8px; }
