@font-face { font-family: "LINE Seed Sans TH"; src: url("/fonts/LINESeedSansTH-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "LINE Seed Sans TH"; src: url("/fonts/LINESeedSansTH-Bold.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
:root {
  --green: #06C755; --green-d: #05a648; --ink: #1d1d1f; --mute: #6e6e73; --line: #e6e6e9;
  --bg: #f5f6f7; --card: #fff; --warn: #e85d04; --red: #d62828; --r: 14px;
  font-family: "LINE Seed Sans TH", -apple-system, "Noto Sans Thai", "Noto Sans Myanmar", "Myanmar Sangam MN", "Myanmar Text", "Pyidaungsu", "Padauk", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; padding-bottom: 96px; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { margin: 0 0 8px; } h3 { font-size: 17px; }
.mt { margin-top: 12px; } .row { display: flex; align-items: center; } .gap { gap: 8px; } .grow { flex: 1; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 14px; }
.muted { color: var(--mute); font-size: 13px; }

.topbar { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; } .brand small { display: block; font-weight: 400; color: var(--mute); font-size: 12px; }
.langs { margin-left: auto; display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.langs button { border: 0; background: none; padding: 6px 10px; font-size: 13px; color: var(--mute); }
.langs button.on { background: var(--green); color: #fff; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; color: var(--ink); white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--green); color: #fff; font-size: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item { background: var(--card); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 6px; border: 2px solid transparent; }
.item.has { border-color: var(--green); }
.item .ic { font-size: 34px; line-height: 1; height: 44px; display: flex; align-items: center; }
.item .ic img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.item .nm { font-weight: 600; line-height: 1.3; min-height: 2.6em; }
.item .sub { color: var(--mute); font-size: 12px; }
.stepper { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: #eef0f2; font-size: 22px; font-weight: 700; }
.stepper button.plus { background: var(--green); color: #fff; }
.stepper input { width: 52px; text-align: center; border: 0; font-size: 20px; font-weight: 700; background: none; }

.bottombar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); z-index: 6; }
.bottombar .wrap { display: flex; gap: 10px; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.btn { border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 600; text-align: center; text-decoration: none; display: inline-block; cursor: pointer; }
.btn.primary { background: var(--green); color: #fff; } .btn.primary:disabled { background: #b8e9cc; }
.btn.ghost { background: #eef0f2; color: var(--ink); } .btn.danger { background: #fde8e8; color: var(--red); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.nav { display: flex; gap: 6px; padding: 10px 0 0; }
.nav a { flex: 1; white-space: nowrap; text-align: center; padding: 8px; border-radius: 10px; color: var(--mute); text-decoration: none; background: #eef0f2; font-size: 14px; }
.nav a.on { background: var(--ink); color: #fff; }

.card { background: var(--card); border-radius: var(--r); padding: 14px; margin-bottom: 10px; }
.list .li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list .li:last-child { border-bottom: 0; }
.status { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: #eef0f2; white-space: nowrap; }
.status.sent { background: #e3f8ec; color: var(--green-d); } .status.pending_approval { background: #fff1e6; color: var(--warn); }
.status.cancelled { background: #fde8e8; color: var(--red); } .status.received { background: #e7eefc; color: #2d5bd3; }
.field { display: block; margin: 10px 0; } .field span { display: block; font-size: 13px; color: var(--mute); margin-bottom: 4px; }
.field input, .field select, .field textarea, input.in, select.in { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
textarea { min-height: 70px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; } .seg button { flex: 1; } .seg .on { background: var(--ink); color: #fff; }
.warnbox { background: #fff6ec; color: #7a3a00; border-radius: 12px; padding: 12px; margin: 8px 0; }
.po-text { white-space: pre-wrap; background: #f5f6f7; border-radius: 10px; padding: 12px; font-size: 13px; max-height: 40vh; overflow: auto; font-family: inherit; }

.sheet-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.0); z-index: 20; display: flex; align-items: flex-end; transition: background .2s; }
.sheet-wrap.open { background: rgba(0,0,0,.35); }
.sheet { background: var(--card); width: 100%; max-width: 640px; margin: 0 auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; transform: translateY(100%); transition: transform .2s; }
.sheet-wrap.open .sheet { transform: none; }
.center { text-align: center; padding: 40px 10px; } .big { font-size: 56px; }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; z-index: 30; font-size: 14px; }
.devbar { background: #222; color: #aaa; font-size: 12px; padding: 4px 10px; } .devbar a { color: #ccc; margin-right: 8px; } .devbar a.on { color: #6f6; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; } .tbl td, .tbl th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl td.r, .tbl th.r { text-align: right; } .bar { height: 6px; background: var(--green); border-radius: 3px; }
.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .kpi .card b { display: block; font-size: 22px; }
.upsell { background: linear-gradient(135deg,#e9fbf0,#fff); border: 1px dashed var(--green); }
.edit-row { display: grid; grid-template-columns: 44px 1fr 1fr 1fr 70px 70px 30px; gap: 6px; align-items: center; margin: 6px 0; }
.edit-row input { padding: 8px; border: 1px solid var(--line); border-radius: 8px; width: 100%; font-size: 14px; }
.x { border: 0; background: none; color: var(--red); font-size: 18px; }
@media (max-width: 520px) { .edit-row { grid-template-columns: 40px 1fr 1fr 60px; } .edit-row .hide-sm { display: none; } }
[hidden] { display: none !important; }

/* onboarding */
.brand-logo { height: 30px; display: block; }
.ob-hero { text-align: center; padding: 28px 8px 8px; }
.ob-logo { width: 180px; max-width: 60%; }
.ob-hero h1 { font-size: 24px; line-height: 1.35; margin: 14px 0 8px; }
.ob-hero p { color: var(--mute); font-size: 15px; line-height: 1.6; margin: 0 auto 18px; max-width: 520px; }
.ob-hero .btn { display: inline-block; padding: 12px 28px; font-size: 16px; text-decoration: none; }
.ob-flow { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 0; }
.ob-phone, .ob-chat { width: 46%; max-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 10px; box-shadow: 0 6px 20px rgba(6,199,85,.10); font-size: 12px; }
.ob-ph-head, .ob-chat-head { font-weight: 700; margin-bottom: 8px; font-size: 12px; }
.ob-ph-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; border-bottom: 1px dashed var(--line); gap: 6px; }
.ob-qty { white-space: nowrap; color: var(--mute); } .ob-qty b { color: var(--ink); }
.ob-ph-btn { margin-top: 8px; background: var(--green); color: #fff; text-align: center; border-radius: 10px; padding: 7px; font-weight: 700; }
.ob-arrow { color: var(--green); font-size: 22px; flex: none; }
.ob-chat { background: #8cabd8; border-color: #8cabd8; }
.ob-chat-head { color: #fff; } .ob-line { background: var(--green); color: #fff; border-radius: 4px; padding: 0 4px; font-size: 10px; }
.ob-bubble { background: #fff; border-radius: 12px; overflow: hidden; }
.ob-bub-top { background: var(--green); color: #fff; font-weight: 700; padding: 6px 8px; font-size: 11px; }
.ob-bub-body { padding: 8px; line-height: 1.7; } .ob-bub-body span { letter-spacing: 4px; }
.ob-steps { display: grid; gap: 12px; }
.ob-step { display: grid; grid-template-columns: 28px 40px 1fr; align-items: center; gap: 10px; }
.ob-num { width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.ob-ic { width: 40px; height: 40px; border-radius: 12px; background: #e9f9ef; display: grid; place-items: center; font-size: 20px; }
.ob-why { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; } .ob-why li { color: var(--ink); }
@media (min-width: 640px) { .ob-steps { grid-template-columns: 1fr 1fr; } .ob-hero h1 { font-size: 28px; } }

.brand.with-ic::before { content: ''; display: inline-block; width: 22px; height: 22px; margin-right: 6px; vertical-align: -5px; background: url("/icon.png") center / contain no-repeat; border-radius: 6px; }
