
:root {
  --pink: #D6006F;
  --hot: #FF1F8E;
  --ink: #111111;
  --bg: #F5F5F5;
  --card: #FFFFFF;
  --line: #E4E4E4;
  --muted: #555555;
  --danger: #B00020;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Thai", "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--hot); outline-offset: 2px; }

.busybar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: var(--hot); animation: busy 1.1s ease-in-out infinite; transform-origin: left; }
@keyframes busy { 0% { transform: scaleX(0.05); } 60% { transform: scaleX(0.85); } 100% { transform: scaleX(1); opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .busybar { animation: none; } }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--ink); color: #fff;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { font-weight: 700; font-size: 20px; letter-spacing: 0.2px; background: none; border: 0; color: #fff; padding: 0; }
.logo b { color: var(--hot); }
.who { color: #fff; background: transparent; border: 1px solid #666; border-radius: 18px; padding: 4px 12px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 36px; font-size: 14px; }

.main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); outline: none; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.hot { color: var(--hot); }
.title { font-size: 20px; font-weight: 700; }
.h3 { font-size: 16px; font-weight: 700; }

.card { background: var(--card); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); }
.card.hero { background: var(--ink); color: #fff; border-color: var(--ink); padding: 20px 16px; }
.hero-title { font-size: 22px; font-weight: 700; }
.hero-sub { color: #d6d6d6; font-size: 14px; }
.cardbtn { text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer; }
.cardbtn:hover { border-color: var(--pink); }
.card.accent { border: 2px solid var(--pink); }
.card.soft { background: #FFF0F7; border-color: #F6C3DB; }

.price { color: var(--pink); font-weight: 700; }
.price.big { font-size: 24px; }
.amount-pending { color: var(--muted); font-weight: 700; }

.btn { background: var(--pink); color: #fff; border: 0; border-radius: 9px; padding: 7px 16px; min-height: 40px; font-size: 15px; font-weight: 600; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.dark { background: var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #bbb; }
.btn.small { min-height: 32px; padding: 3px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--pink); font-weight: 600; padding: 6px 0; min-height: 34px; text-align: left; }

.field { display: flex; flex-direction: column; gap: 3px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
/* ช่องกรอกพื้นขาว ตัวหนังสือดำเสมอ (รวมช่องวางลิงก์ในกล่องสีดำหน้าแรก) */
.field input, .field textarea, .field select {
  background: #fff; color: var(--ink); border: 1px solid #aaa; border-radius: 8px; padding: 6px 10px; min-height: 40px; width: 100%;
}
.field input::placeholder, .field textarea::placeholder { color: #8a8a8a; opacity: 1; }
.field textarea { min-height: 60px; resize: vertical; }
.hero .field input { border-color: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.error { color: var(--danger); background: #FDECEF; border: 1px solid #F3B7C2; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.notice { background: #fff; border-left: 4px solid var(--pink); padding: 8px 10px; font-size: 14px; border-radius: 4px; }
.notice.warn { background: #FFF7E0; border-left-color: #C98A00; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 34px; cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; accent-color: var(--pink); }
.addr { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }

/* ป้ายสถานะ: สีตามความสำคัญ (ค่าเริ่มต้นสีดำ) */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 12px; background: var(--ink); color: #fff; white-space: nowrap; }
.badge.pink { background: var(--pink); }
.badge.grey { background: #E4E4E4; color: #222; }
.badge.yellow { background: #FFE27A; color: #4A3600; }
.badge.paid { background: #CFF2DC; color: #0B5A2E; }
.badge.blue { background: #DCEBFF; color: #0B3D7A; }
.badge.shipped { background: #0B6B3A; color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ปุ่มตัวเลือกสินค้า (สี/ไซซ์) */
.fieldlabel { font-weight: 600; font-size: 14px; }
.optgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.optbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: #fff; color: var(--ink); border: 1px solid #bbb; border-radius: 9px; padding: 5px 10px; min-height: 38px; font-size: 14px; text-align: left; max-width: 100%; }
.optbtn .optprice { font-size: 12px; color: var(--pink); font-weight: 700; }
.optbtn[aria-pressed="true"] { border: 2px solid var(--pink); background: #FFF0F7; font-weight: 700; }
.optbtn:disabled { opacity: 0.5; cursor: not-allowed; }
.optbtn:disabled .optprice { color: var(--muted); }
.field input[readonly] { background: #F2F2F2; }

/* เวลาจบประมูล / ช่องทางชำระเงิน / หลักฐาน */
.endtime { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; font-size: 14px; text-align: right; }
.paybox { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px dashed #bbb; border-radius: 10px; padding: 10px; }
.qr { width: 100%; max-width: 260px; align-self: center; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.proofprev { display: flex; justify-content: center; min-height: 40px; }
.proofprev img { max-width: 100%; max-height: 50vh; border-radius: 8px; border: 1px solid var(--line); }

.item { display: flex; gap: 12px; }
.thumb { width: 76px; height: 76px; border-radius: 8px; background: #E9E9E9; object-fit: cover; flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.lines { display: flex; flex-direction: column; gap: 2px; border-top: 1px dashed var(--line); padding-top: 8px; }
.lines .row { font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.timeline li { font-size: 14px; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }

.empty { text-align: center; color: var(--muted); padding: 24px 8px; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottomnav button { flex: 1; background: none; border: 0; padding: 10px 4px; min-height: 56px; color: var(--muted); font-size: 13px; position: relative; }
.bottomnav button[aria-current="page"] { color: var(--pink); font-weight: 700; }
.bottomnav button[aria-current="page"]::after { content: ""; position: absolute; left: 25%; right: 25%; top: 0; height: 3px; background: var(--hot); border-radius: 0 0 3px 3px; }
.count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--pink); color: #fff; font-size: 11px; line-height: 18px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: 90%; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.toast.error { background: var(--danger); }
.toast.ok { background: #0B6B3A; }

.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 640px; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow: auto; }

@media (min-width: 700px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 16px; }
}


/* ภาพตกแต่งหน้าแรก / ขั้นตอน / ออเดอร์ว่าง (App.html) */
/* ปุ่มแสดง/ซ่อนรหัสผ่าน */
.j2t-pwwrap { position: relative; display: block; }
.j2t-pwwrap input { width: 100%; padding-right: 48px; }
.j2t-pwbtn { position: absolute; top: 0; right: 0; bottom: 0; width: 46px; display: grid; place-items: center; background: none; border: 0; color: #666; padding: 0; }
.j2t-pwbtn svg { width: 22px; height: 22px; }
.j2t-pwbtn[aria-pressed="true"] { color: var(--hot, #ff2d87); }
.j2t-hero-art { display: block; width: 100%; height: auto; margin-bottom: 10px; }
.j2t-petal { animation: j2t-drift 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.j2t-petal.d2 { animation-duration: 9s; animation-delay: -3s; }
.j2t-petal.d3 { animation-duration: 8s; animation-delay: -5s; }
.j2t-bob { animation: j2t-bob 3s ease-in-out infinite; }
@keyframes j2t-drift { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(7px, 9px) rotate(60deg); } }
@keyframes j2t-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.j2t-perks { display: flex; flex-wrap: wrap; gap: 6px; }
.j2t-perks span { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid #ffc2dc; color: #111; }
.j2t-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.j2t-step { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line, #eee); border-radius: 14px; background: #fff; }
.j2t-step svg { width: 28px; height: 28px; color: var(--hot, #ff2d87); }
.j2t-step .num { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: #111; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.j2t-step strong { font-size: 14px; }
.j2t-step span { font-size: 12.5px; line-height: 1.45; color: var(--muted, #666); }
.j2t-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.j2t-empty-art { width: 120px; height: auto; }
.j2t-contacts { display: flex; flex-wrap: wrap; gap: 8px; }
.j2t-contacts a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line, #e5e5e5); border-radius: 999px; background: #fff; color: #111; font-size: 14px; font-weight: 600; text-decoration: none; }
.j2t-contacts a:active { background: #fff0f6; }
.j2t-ico { width: 20px; height: 20px; flex: none; display: inline-block; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
svg.j2t-ico { -webkit-mask: none; mask: none; }
.j2t-trust { display: flex; flex-direction: column; gap: 12px; }
.j2t-trust-row { display: flex; gap: 12px; align-items: flex-start; }
.j2t-trust-row div { display: flex; flex-direction: column; gap: 2px; }
.j2t-trust-row strong { font-size: 15px; }
.j2t-trust-row span { font-size: 13px; line-height: 1.5; color: var(--muted, #666); }
.j2t-trust-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #fff0f6; display: grid; place-items: center; }
.j2t-trust-ico svg { width: 22px; height: 22px; color: var(--hot, #ff2d87); }
.j2t-faq { border-bottom: 1px solid var(--line, #eee); padding: 10px 0; }
.j2t-faq:last-child { border-bottom: 0; }
.j2t-faq summary { font-weight: 700; cursor: pointer; list-style-position: inside; }
.j2t-faq p { margin: 8px 0 0; font-size: 14px; line-height: 1.6; }
.j2t-slides { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.j2t-slides::-webkit-scrollbar { display: none; }
.j2t-slide { flex: 0 0 calc((100% - 20px) / 2.4); margin: 0; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; }
.j2t-slide img { display: block; width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; border-radius: 12px; background: #f3f3f3; }
.j2t-slide figcaption { font-size: 12px; line-height: 1.4; font-weight: 600; color: #444; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.j2t-cta { background: #111; color: #fff; }
.j2t-cta .muted { color: #ddd; }
@media (prefers-reduced-motion: reduce) { .j2t-petal, .j2t-bob { animation: none; } }
/* แถบสถานะออเดอร์: ไอคอน + เส้นจุดไข่ปลา */
.j2t-trk { display: flex; align-items: flex-start; padding: 4px 10px 0; }
.j2t-trk .st { flex: none; width: 34px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.j2t-trk .ic { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #EEE; color: #9A9A9A; }
.j2t-trk .ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.j2t-trk .lb { font-size: 10.5px; line-height: 1.25; color: #8A8A8A; width: 58px; margin: 0 -12px; }
.j2t-trk .ln { flex: 1; margin: 15px 4px 0; border-top: 3px dotted #CFCFCF; min-width: 4px; }
.j2t-trk .ln.done { border-top-color: var(--pink); }
.j2t-trk .done .ic { background: var(--pink); color: #fff; }
.j2t-trk .done .lb { color: var(--ink); }
.j2t-trk .cur .ic { background: #fff; color: var(--pink); box-shadow: 0 0 0 2.5px var(--hot), 0 0 0 5px rgba(255,31,142,.15); }
.j2t-trk .cur .lb { color: var(--pink); font-weight: 700; }
.j2t-trk .wait .ic { background: #fff; color: #B07E00; box-shadow: 0 0 0 2.5px #E0A100, 0 0 0 5px rgba(224,161,0,.18); }
.j2t-trk .wait .lb { color: #8A6300; font-weight: 700; }
.j2t-trk.mini { padding: 2px 6px 0; }
.j2t-trk.mini .st { width: 24px; }
.j2t-trk.mini .ic { width: 24px; height: 24px; }
.j2t-trk.mini .ic svg { width: 13px; height: 13px; }
.j2t-trk.mini .ln { margin-top: 11px; border-top-width: 2.5px; }
.j2t-trk-x { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.j2t-trk-x .ic { width: 28px; height: 28px; border-radius: 50%; background: #EEE; color: #888; display: flex; align-items: center; justify-content: center; flex: none; }
.j2t-trk-x .ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
/* สินค้าที่ไม่รับสั่ง */
.j2t-ban { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 13px; line-height: 1.45; background: #FFF7E0; color: #4A3600; border-left: 4px solid #C98A00; border-radius: 6px; padding: 7px 10px; }
.j2t-ban strong { color: #4A3600; }
.j2t-ban .linkbtn { min-height: 0; padding: 0; font-size: 13px; }
.j2t-banlist { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }


.adm-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.adm-tabs button { flex: none; background: #fff; border: 1px solid #bbb; border-radius: 18px; padding: 6px 16px; min-height: 40px; font-size: 14px; font-weight: 600; }
.adm-tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.adm-toolbar { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .adm-toolbar { grid-template-columns: 2fr 1fr; } }
.adm-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-inline select, .adm-select { flex: 1; min-width: 150px; background: #fff; color: var(--ink); border: 1px solid #aaa; border-radius: 10px; padding: 8px 10px; min-height: 42px; width: 100%; }
.adm-line { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.adm-line:last-child { border-bottom: 0; }
.adm-main { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }
.adm-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.adm-strike { text-decoration: line-through; color: var(--muted); }
.adm-credit { color: #0B6B3A; font-weight: 700; }
.adm-warn { background: #FFF7E0; border-left: 4px solid #C98A00; padding: 8px 10px; font-size: 14px; border-radius: 4px; }
.adm-box { background: #FFF0F7; border: 1px solid #F6C3DB; border-radius: 8px; padding: 8px 10px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.adm-pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.adm-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
details.card > summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.adm-id { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge-new { background: var(--hot); color: #fff; letter-spacing: 0.5px; animation: adm-blink 1s ease-in-out infinite; }
@keyframes adm-blink { 50% { opacity: 0.25; } }
.blink-bg { animation: adm-blink-bg 1.2s ease-in-out infinite; }
@keyframes adm-blink-bg { 50% { background-color: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--hot); } }
@media (prefers-reduced-motion: reduce) { .badge-new, .blink-bg { animation: none; } }
/* หน้ารายละเอียดออเดอร์: สีของแต่ละส่วน (แถบซ้าย + พื้นอ่อน) */
.adm-sec .card { border-left-width: 6px; border-left-style: solid; }
.adm-sec-head .card { border-left-color: #111111; }
.adm-sec-items .card { border-left-color: #3B82F6; background: #F3F8FF; }
.adm-sec-raise .card { border-left-color: #8B5CF6; background: #F7F3FF; }
.adm-sec-r1 .card { border-left-color: #FF1F8E; background: #FFF5FA; }
.adm-sec-r2 .card { border-left-color: #E0A100; background: #FFFAEB; }
.adm-sec-ship .card { border-left-color: #16A34A; background: #F2FBF5; }
.adm-sec-track .card { border-left-color: #0E9FAE; background: #F0FAFB; }
.adm-sec-hist .card { border-left-color: #9CA3AF; background: #F7F7F7; }
