/* CHAKRIYA SHOP — ភាសារចនាដូច OBMS (ខៀវ #007AFF · ផ្ទៃ #F2F2F7 · Liquid Glass Tinted) */
:root {
  --blue: #007AFF;
  --blue-tint: rgba(0,122,255,.10);
  --bg: #F2F2F7;
  --paper: #FFFFFF;
  --ink: #000000;
  --ink-2: rgba(60,60,67,.62);
  --ink-3: rgba(60,60,67,.32);
  --line: rgba(60,60,67,.14);
  --red: #FF3B30;
  --red-tint: rgba(255,59,48,.10);
  --orange: #FF9500;
  --glass: blur(20px) saturate(180%);
  --r-card: 20px;
  --r-btn: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Kantumruy Pro', system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.55; letter-spacing: -0.01em;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: inherit; text-decoration: none; }
img { display: block; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }

/* ── របារខាងលើ ── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 58px; padding: env(safe-area-inset-top, 0px) 16px 0;
  background: rgba(255,255,255,.72);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  border-bottom: .5px solid var(--line);
}
.logo { display: flex; flex-direction: column; line-height: 1.15; }
.logo b { font-family: 'Battambang', serif; font-weight: 900; font-size: 22px; }
.logo small { font-size: 11px; letter-spacing: .04em; color: var(--ink-2); }
.logo.sm b { font-size: 20px; }
.top-p { padding-left: 6px; padding-right: 6px; }
.ib { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); }
.ib:active { background: var(--blue-tint); }

/* ── តម្រង ── */
.chips { display: flex; gap: 8px; padding: 12px 14px 4px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 16px; border-radius: 999px;
  display: inline-flex; align-items: center; font-size: 13px;
  background: rgba(255,255,255,.72); border: 1px solid rgba(20,20,20,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 2px 8px rgba(20,20,20,.06);
}
.chip.on {
  color: #fff; font-weight: 600; border-color: rgba(255,255,255,.35);
  background: linear-gradient(180deg, rgba(30,136,255,.96), rgba(0,122,255,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 12px rgba(0,60,140,.26);
}

/* ── Feed ── */
.feed { padding: 12px 12px 28px; max-width: 1080px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 680px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  background: var(--paper); border-radius: var(--r-card); padding: 3px;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(20,20,20,.04), 0 8px 20px rgba(20,20,20,.06);
  transition: transform .15s;
}
.card:active { transform: scale(.98); }
.card-img {
  position: relative; aspect-ratio: 1 / 1; border-radius: 17px; overflow: hidden; background: #E5E5EA;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 8px; left: 8px; height: 22px; padding: 0 8px; border-radius: 11px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center;
}
.badge.inline { position: static; margin-bottom: 6px; }
.soldout {
  position: absolute; inset: auto 8px 8px; height: 26px; border-radius: 13px;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(0,0,0,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.card-body { padding: 10px 9px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-name {
  margin: 0; font-size: 15px; font-weight: 700; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pr-now { font-weight: 700; color: var(--ink); }
.pr-now.sale { color: var(--red); }
.pr-old { color: var(--ink-2); font-size: 13px; }
.btn-soft {
  margin-top: auto; height: 38px; border-radius: var(--r-btn);
  display: grid; place-items: center; font-size: 14px; font-weight: 600;
  color: var(--blue); background: rgba(118,118,128,.12);
}
.empty { text-align: center; color: var(--ink-2); padding: 60px 20px; line-height: 2; }
.foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 8px 16px 32px; }

/* ── ប៊ូតុង ── */
.btn-primary {
  height: 48px; padding: 0 22px; border-radius: var(--r-btn);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 16px;
  background: linear-gradient(180deg, rgba(30,136,255,.96), rgba(0,122,255,.94));
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 16px rgba(0,60,140,.26);
}
.btn-primary:disabled { opacity: .55; box-shadow: none; cursor: default; }
.btn-primary.inline { margin-top: 16px; height: 44px; }

/* ── ទំព័រទំនិញ ── */
.pg-product { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.pd { max-width: 620px; margin: 0 auto; padding: 12px 12px 20px; display: flex; flex-direction: column; gap: 12px; }
.box { background: var(--paper); border-radius: var(--r-card); box-shadow: 0 1px 2px rgba(20,20,20,.04); }
.box.pad { padding: 16px; }

.gl { position: relative; padding: 3px; }
.gl-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 17px;
  scrollbar-width: none;
}
.gl-track::-webkit-scrollbar { display: none; }
.gl-item { flex: 0 0 100%; aspect-ratio: 1 / 1; scroll-snap-align: start; background: #E5E5EA; }
.gl-item img { width: 100%; height: 100%; object-fit: cover; }
.gl-count {
  position: absolute; right: 14px; bottom: 14px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; color: #fff; background: rgba(0,0,0,.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.pd-name { margin: 0 0 6px; font-size: 22px; line-height: 1.4; font-weight: 700; }
.pd-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.pd-price .pr-now { font-size: 24px; color: var(--blue); }
.pd-price .pr-now.sale { color: var(--red); }
.pd-price .pr-old { font-size: 15px; }
.pd-usd { color: var(--ink-2); font-size: 13px; margin-top: 2px; }

.sec + .sec { margin-top: 16px; padding-top: 16px; border-top: .5px solid var(--line); }
.sec-h { font-weight: 600; margin-bottom: 10px; }
.sec-h span { color: var(--ink-2); font-weight: 400; }

.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt {
  text-align: left; padding: 10px 12px; border-radius: var(--r-btn);
  border: 1.5px solid var(--line); display: flex; flex-direction: column;
}
.opt small { color: var(--ink-2); font-size: 12px; }
.opt.on { border-color: var(--blue); background: var(--blue-tint); }
.opt.on b { color: var(--blue); }

.colors { display: flex; flex-wrap: wrap; gap: 10px; }
.sw {
  width: 40px; height: 40px; border-radius: 50%; padding: 3px;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.sw span { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.15); }
.sw.on { box-shadow: inset 0 0 0 2.5px var(--blue); }
.sw.out { opacity: .4; }
.sw.txt { width: auto; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; }

.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.sz {
  position: relative; height: 44px; border-radius: var(--r-btn); font-weight: 600;
  background: rgba(118,118,128,.12);
}
.sz.on { background: var(--blue); color: #fff; }
.sz.low::after {
  content: ''; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--orange);
}
.sz:disabled { color: var(--ink-3); text-decoration: line-through; background: rgba(118,118,128,.06); cursor: default; }
.sz-note { min-height: 20px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.sz-note.low { color: var(--orange); }

.desc { margin: 0; white-space: pre-wrap; color: rgba(0,0,0,.82); }

.rows { padding: 4px 16px; }
.row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; color: var(--blue); }
.row + .row { border-top: .5px solid var(--line); }
.row div { display: flex; flex-direction: column; color: var(--ink); }
.row small { color: var(--ink-2); font-size: 13px; }

.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.78);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  border-top: .5px solid var(--line);
}
.bb-price { font-weight: 700; font-size: 18px; white-space: nowrap; }
.buybar .btn-primary { flex: 1; }
@media (min-width: 680px) {
  .buybar { left: 50%; right: auto; width: 620px; transform: translateX(-50%); border-radius: 20px 20px 0 0; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ═════════ V2 — កន្ត្រក · ចូលគណនី · ទំព័រខ្ញុំ ═════════ */
.acts { display: flex; align-items: center; }
.cart-ib { position: relative; }
.cart-n {
  position: absolute; top: 5px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.cart-n[hidden] { display: none; }
.top-title { font-weight: 700; font-size: 17px; }
.ib-space { width: 44px; }
.loading { text-align: center; color: var(--ink-2); padding: 48px 0; }
.pd.narrow { max-width: 480px; }
.soft { color: var(--ink-2); margin: 0; }
.mt { margin-top: 14px; }

.btn-gray {
  height: 48px; padding: 0 16px; border-radius: var(--r-btn);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(118,118,128,.12); color: var(--blue); font-weight: 600; font-size: 15px;
}
.btn-gray.danger { color: var(--red); }
.full { width: 100%; display: flex; }
.btn-primary.full { margin-top: 6px; }

/* របារទិញ: ដាក់កន្ត្រក + ទិញឥឡូវ */
.buybar .btn-gray { flex: none; }
.buybar .btn-gray span { font-size: 14px; }
.buybar .btn-primary { gap: 8px; }
.buybar .btn-primary .bb-price { font-size: 15px; font-weight: 600; opacity: .92; }
.bb-sum { display: flex; flex-direction: column; line-height: 1.25; }
.bb-sum small { color: var(--ink-2); font-size: 12px; }
.bb-sum b { font-size: 19px; }
.sz-note.need { color: var(--red); font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 40; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: #fff; background: rgba(0,0,0,.78);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.toast[hidden] { display: none; }

/* ── ចូលគណនី ── */
.lg-h { margin: 0 0 6px; font-size: 20px; line-height: 1.45; }
.lg-sub { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; }
.btn-provider {
  width: 100%; height: 50px; margin-bottom: 10px; border-radius: var(--r-btn);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 15px;
}
.btn-provider.fb { background: #1877F2; color: #fff; }
.btn-provider.gg { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-provider[hidden] { display: none; }
.lg-note { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,149,0,.12); color: #8A4B00; font-size: 13px; }
.lg-note[hidden] { display: none; }
.lg-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--ink-2); font-size: 13px; }
.lg-or::before, .lg-or::after { content: ''; flex: 1; height: .5px; background: var(--line); }
.seg { display: flex; background: rgba(118,118,128,.12); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; height: 34px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.fld span { font-size: 13px; color: var(--ink-2); }
.fld input {
  height: 48px; padding: 0 14px; border-radius: var(--r-btn); font: inherit; font-size: 16px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.fld input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.link-btn { display: block; margin: 12px auto 0; color: var(--blue); font-size: 14px; }
.link-btn[hidden] { display: none; }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: var(--red-tint); color: var(--red); }
.msg.ok { background: rgba(52,199,89,.12); color: #1E7B3A; }
.msg[hidden] { display: none; }

/* ── កន្ត្រក ── */
.pg-cart .buybar, .pg-cart .pd { }
.cl { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.cl + .cl { border-top: .5px solid var(--line); }
.cl-img { flex: none; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; background: #E5E5EA; }
.cl-img img { width: 100%; height: 100%; object-fit: cover; }
.cl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-info b { font-size: 15px; line-height: 1.4; }
.cl-info small { color: var(--ink-2); font-size: 13px; }
.cl-price { font-weight: 700; margin-top: 2px; }
.cl-price s { color: var(--ink-2); font-weight: 400; font-size: 13px; }
.cl-price em { font-style: normal; color: var(--orange); font-size: 12px; font-weight: 600; }
.cl-out { color: var(--red); font-size: 13px; font-weight: 600; margin-top: 2px; }
.cl.out .cl-img, .cl.out .cl-info b { opacity: .5; }
.cl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.cl-x { width: 28px; height: 28px; border-radius: 50%; background: rgba(118,118,128,.12); color: var(--ink-2); font-size: 18px; line-height: 1; }
.qty { display: flex; align-items: center; border-radius: 10px; background: rgba(118,118,128,.12); }
.qty button { width: 34px; height: 34px; font-size: 18px; font-weight: 700; color: var(--blue); }
.qty button:disabled { color: var(--ink-3); }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.free-bar { padding: 12px 14px; border-radius: 16px; background: var(--blue-tint); font-size: 14px; }
.free-bar div { height: 6px; border-radius: 3px; background: rgba(0,122,255,.18); margin-bottom: 8px; overflow: hidden; }
.free-bar div span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.free-bar b { color: var(--blue); }
.free-bar.ok { background: rgba(52,199,89,.12); color: #1E7B3A; font-weight: 600; }

.sum div { display: flex; justify-content: space-between; padding: 4px 0; }
.sum div span { color: var(--ink-2); }
.sum .tot { margin-top: 6px; padding-top: 10px; border-top: .5px solid var(--line); }
.sum .tot span { color: var(--ink); font-weight: 600; }
.sum .tot b { font-size: 20px; }
.sum small { display: block; margin-top: 6px; color: var(--ink-2); font-size: 12px; }
.sum.mini { margin: 12px 0; }
.empty-cart { text-align: center; padding: 40px 16px; }
.empty-cart p { color: var(--ink-2); margin: 0 0 16px; }

.sheet-bg {
  position: fixed; inset: 0; z-index: 50; background: rgba(20,30,55,.32);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.sheet-bg[hidden] { display: none; }
.sheet-card {
  width: 100%; max-width: 520px; background: #fff; border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}
.sheet-grab { width: 38px; height: 5px; border-radius: 3px; background: rgba(60,60,67,.2); margin: 0 auto 14px; }
.sheet-card h2 { margin: 0 0 6px; font-size: 20px; }
.sheet-card p { margin: 0 0 12px; color: var(--ink-2); }
.sheet-who { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.sheet-who span { color: var(--ink-2); }

/* ── ទំព័រខ្ញុំ ── */
.me-name { font-size: 20px; font-weight: 700; }
.me-line { margin-top: 2px; }
.me-line.soft { color: var(--ink-2); font-size: 14px; }
[data-logout][hidden], [data-me][hidden] { display: none; }
.buybar .btn-primary, .buybar .btn-gray { white-space: nowrap; }
@media (max-width: 380px) {
  .buybar .btn-gray span { display: none; }
  .buybar .btn-gray { width: 52px; padding: 0; }
}

/* ═════════ V4 — បញ្ជាទិញ · Order របស់ខ្ញុំ ═════════ */
.fld select {
  height: 48px; padding: 0 12px; border-radius: var(--r-btn); font: inherit; font-size: 16px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); appearance: auto;
}
.co-who { display: flex; justify-content: space-between; gap: 12px; }
.co-who span { color: var(--ink-2); }
.link-btn.left { margin: 8px 0 0; }
.co-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.co-line small { display: block; color: var(--ink-2); font-size: 13px; }
.co-warn { color: var(--orange); font-size: 13px; margin: 6px 0; }
.test-note { text-align: center; font-size: 13px; color: #8A4B00; background: rgba(255,149,0,.12); border-radius: 12px; padding: 10px 12px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0; }
.done { text-align: center; }
.done-ic { width: 64px; height: 64px; margin: 8px auto 12px; border-radius: 50%; display: grid; place-items: center; background: rgba(52,199,89,.14); color: #1E7B3A; font-size: 30px; font-weight: 700; }
.done .btn-primary.full { margin-top: 10px; }
.mo { padding: 12px 0; display: flex; flex-direction: column; gap: 4px; }
.mo + .mo { border-top: .5px solid var(--line); }
.mo small { color: var(--ink-2); font-size: 13px; }
.mo-top, .mo-bot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mo-bot span { color: var(--ink-2); font-size: 13px; }
.mo-st { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: rgba(118,118,128,.12); color: var(--ink-2); }
.mo-st.paid { background: rgba(52,199,89,.14); color: #1E7B3A; }
.mo-st.pending_payment { background: rgba(255,149,0,.14); color: #8A4B00; }
.pg-checkout .pd { gap: 12px; }
[data-co][hidden], [data-done][hidden] { display: none; }
[data-co] { display: flex; flex-direction: column; gap: 12px; }
.pg-cart, .pg-checkout { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

/* ═════════ V5 — ក្រុមហ៊ុនដឹក + ជ្រើសទីតាំង ═════════ */
.courier { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cr {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left;
  padding: 10px 12px; border-radius: var(--r-btn); border: 1.5px solid var(--line); background: #fff;
}
.cr b { font-size: 15px; }
.cr small { font-size: 12px; color: var(--ink-2); }
.cr.on { border-color: var(--blue); background: var(--blue-tint); }
.cr.on b { color: var(--blue); }
.cr:disabled { opacity: .5; cursor: default; }
.fld select:disabled { background: rgba(118,118,128,.06); color: var(--ink-2); }

/* ═════════ V6 — ទំព័រគោលការណ៍ · លុបគណនី ═════════ */
.doc h1 { font-size: 22px; margin: 0 0 4px; line-height: 1.4; }
.doc h2 { font-size: 16px; margin: 20px 0 6px; }
.doc p, .doc li { line-height: 1.75; }
.doc ul { padding-left: 20px; margin: 6px 0; }
.doc a, .foot a, .lg-legal a, .me-links a { color: var(--blue); }
.doc hr { border: 0; border-top: .5px solid var(--line); margin: 22px 0 6px; }
.doc [data-del] { margin: 8px 0; }
.lg-legal { margin: 14px 0 0; font-size: 12px; color: var(--ink-2); text-align: center; }
.me-links { text-align: center; font-size: 13px; color: var(--ink-2); margin: 4px 0 0; }
.me-links[hidden] { display: none; }
.foot { line-height: 2; }

/* ═════════ V7 — អំពីហាង ═════════ */
.biz { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 8px 0 0; }
.biz dt { color: var(--ink-2); }
.biz dd { margin: 0; font-weight: 500; }
@media (max-width: 380px) { .biz { grid-template-columns: 1fr; } .biz dd { margin-bottom: 6px; } }

/* ═════════ V9 — លម្អិត Order (តាមគំរូ F7) ═════════ */
a.mo { color: inherit; text-decoration: none; }
.mo-go { font-style: normal; color: var(--ink-2); font-weight: 400; margin-left: 4px; }
.mo-st.test, .mo-st.packing { background: rgba(0,122,255,.12); color: #0A58B5; }
.mo-st.shipped, .mo-st.delivered { background: rgba(52,199,89,.14); color: #1E7B3A; }
.mo-st.cancelled { background: rgba(255,59,48,.12); color: #B3261E; }
.od-brand { flex: 1; text-align: center; font-family: 'Battambang', serif; font-weight: 900; font-size: 18px; color: var(--ink); text-decoration: none; }
.pg-order { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.pg-order .pd { gap: 12px; }
.od { display: flex; flex-direction: column; gap: 12px; }
.od[hidden] { display: none; }
.od .box { border-radius: 22px; }
.od .box.pad { padding: 18px; }
.od .soft { color: var(--ink-2); font-size: 13px; }
.od-h { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.od-head { display: flex; flex-direction: column; gap: 10px; }
.od-row { display: flex; justify-content: space-between; align-items: center; }
.od-pill { height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.od-pill i { width: 7px; height: 7px; border-radius: 4px; background: currentColor; }
.od-pill.green { background: rgba(52,199,89,.14); color: #248A3D; }
.od-pill.orange { background: rgba(255,149,0,.14); color: #A05A00; }
.od-pill.blue { background: rgba(0,122,255,.12); color: #0A58B5; }
.od-pill.red { background: rgba(255,59,48,.12); color: #B3261E; }
.od-no { font-size: 30px; font-weight: 700; letter-spacing: .02em; }
.od-meta { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.od-meta b { color: var(--ink); }
.od-head .test-note { margin: 0; }
.od-tl { list-style: none; margin: 0; padding: 0; }
.od-tl li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.od-tl li:last-child { padding-bottom: 0; }
.od-tl li::before { content: ''; position: absolute; left: 11px; top: 28px; bottom: 2px; width: 2px; background: rgba(60,60,67,.18); }
.od-tl li:last-child::before { display: none; }
.od-tl li.done::before { background: #34C759; }
.od-dot { flex: none; width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(60,60,67,.2); }
.od-tl li.done .od-dot { background: #34C759; box-shadow: none; }
.od-tl li.now .od-dot { box-shadow: inset 0 0 0 2px #FF9500; }
.od-tl li.now .od-dot i { width: 10px; height: 10px; border-radius: 5px; background: #FF9500; }
.od-tl b { display: block; font-size: 16px; font-weight: 600; }
.od-tl li:not(.done):not(.now) b { color: rgba(60,60,67,.45); }
.od-tl small { display: block; font-size: 13px; color: var(--ink-2); }
.od-cancel { color: #B3261E; font-weight: 600; }
.od-phs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.od-ph { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
.od-ph-img { aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; background: #E5E5EA; }
.od-ph-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.od-ph-img.empty { background: rgba(118,118,128,.05); border: 1.5px dashed rgba(60,60,67,.25); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; color: rgba(60,60,67,.35); }
.od-ph-img.empty small { font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.od-ph b { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.od-ph b svg { color: var(--blue); }
.od-ph > small { font-size: 12px; color: var(--ink-2); margin-top: -4px; }
.od-track { margin-top: 12px; padding-top: 12px; border-top: .5px solid var(--line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.od-track span { color: var(--ink-2); flex-basis: 100%; font-size: 13px; }
.od-track .link-btn { margin-left: auto; padding: 0; }
.od-its { display: flex; flex-direction: column; gap: 12px; }
.od-it { display: flex; gap: 12px; align-items: center; }
.od-th { width: 56px; height: 56px; flex: none; border-radius: 12px; background: #E5E5EA; overflow: hidden; }
.od-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.od-it-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.od-it-t b { font-size: 15px; font-weight: 600; }
.od-it-t small { font-size: 13px; color: var(--ink-2); }
.od-it-p { font-size: 15px; font-weight: 600; }
.od-sep { height: .5px; background: rgba(60,60,67,.29); margin: 12px 0; }
.od-sum { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); padding: 2px 0; }
.od-total { font-size: 16px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.od-who { font-size: 15px; font-weight: 600; }
.od-addr { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin-top: 4px; }
.od-line { height: 52px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; font-size: 16px; }
.od-bar .btn-primary.full { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }

/* ═════════ V10 — ទំព័រខ្ញុំ (F8) · បញ្ជាទិញជោគជ័យ (F7a) ═════════ */
.pg-me .pd { gap: 12px; }
.me-title { display: flex; align-items: flex-end; justify-content: space-between; padding: 6px 8px 0; }
.me-title h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.028em; line-height: 1.2; }
.me-title span { font-family: 'Battambang', serif; font-weight: 900; font-size: 16px; color: var(--ink-2); padding-bottom: 6px; }
.pg-me .box { border-radius: 22px; }
.pg-me [hidden] { display: none !important; }
.me-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.me-top { display: flex; align-items: center; gap: 14px; }
.me-av { width: 64px; height: 64px; flex: none; border-radius: 32px; background: #E5E5EA; color: rgba(60,60,67,.35); position: relative; display: grid; place-items: center; }
.me-badge { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 10px; box-shadow: 0 0 0 2px #fff; color: #fff; font: 800 12px/20px Arial, sans-serif; text-align: center; }
.me-badge.fb { background: #1877F2; } .me-badge.gg { background: #EA4335; } .me-badge.em { background: #8E8E93; }
.me-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.me-id b { font-size: 20px; font-weight: 700; }
.me-id span { font-size: 14px; color: var(--ink-2); }
.me-id small { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-edit { height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(120,120,128,.12); color: var(--blue); font-size: 14px; font-weight: 600; display: flex; align-items: center; text-decoration: none; }
.me-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.me-counts a { height: 64px; border-radius: 14px; background: rgba(118,118,128,.08); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.me-counts b { font-size: 20px; font-weight: 700; }
.me-counts b.c-wait { color: #FF9500; } .me-counts b.c-ship { color: var(--blue); }
.me-counts span { font-size: 12px; color: var(--ink-2); }
.me-h { padding: 6px 6px 0; }
.me-h span { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.me-list { overflow: hidden; display: flex; flex-direction: column; }
.me-list .pad { padding: 16px; margin: 0; }
.me-order, .me-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; color: var(--ink); text-decoration: none; background: transparent; border: 0; font: inherit; text-align: left; width: 100%; min-height: 54px; }
.me-order + .me-order::before, .me-row + .me-row::before { content: ''; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: rgba(60,60,67,.29); }
.me-row + .me-row::before { left: 60px; }
.mo-ths { display: flex; flex: none; }
.mo-th { width: 44px; height: 44px; border-radius: 10px; background: #E5E5EA; overflow: hidden; box-shadow: 0 0 0 2px #fff; }
.mo-th + .mo-th { margin-left: -14px; }
.mo-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mo-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mo-t b { font-size: 15px; font-weight: 700; }
.mo-t small { font-size: 13px; color: var(--ink-2); }
.od-pill.sm { height: 26px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.chev { flex: none; color: rgba(60,60,67,.32); }
.me-ic { width: 32px; height: 32px; flex: none; border-radius: 9px; background: rgba(0,122,255,.10); color: var(--blue); display: grid; place-items: center; }
.me-ic.gray { background: rgba(118,118,128,.12); color: rgba(60,60,67,.75); }
.me-ic.red { background: rgba(255,59,48,.10); color: #FF3B30; }
.me-rl { flex: 1; min-width: 0; font-size: 16px; display: flex; flex-direction: column; gap: 2px; }
.me-rl small { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.me-rr { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.me-row.red { color: #FF3B30; }
.me-row:disabled { opacity: .5; }
.me-an { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.me-an em { font-style: normal; height: 20px; padding: 0 8px; border-radius: 999px; background: rgba(0,122,255,.10); color: #0062CC; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; }
.me-del { align-self: center; min-height: 44px; display: flex; align-items: center; font-size: 13px; color: var(--ink-2); }

.od-ok { padding: 26px 18px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.od-ok h1 { margin: 4px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.od-ok p { margin: 0; font-size: 15px; color: var(--ink-2); }
.od-ok-ic { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.od-ok-ic span { position: absolute; border-radius: 50%; background: rgba(52,199,89,.12); inset: 0; }
.od-ok-ic span + span { inset: 10px; background: rgba(52,199,89,.18); }
.od-ok-ic b { position: relative; width: 52px; height: 52px; border-radius: 26px; background: #34C759; box-shadow: 0 6px 16px rgba(52,199,89,.35); display: grid; place-items: center; animation: okPop .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes okPop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.od-ok-no { margin-top: 8px; padding: 10px 18px; border-radius: 14px; background: rgba(118,118,128,.08); display: flex; flex-direction: column; align-items: center; }
.od-ok-no small { font-size: 12px; color: var(--ink-2); }
.od-ok-no b { font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.od-ok-sum { font-size: 13px !important; }
.od-ok-sum b { color: var(--ink); }
.od-ok .test-note { margin-top: 6px; }
.od-bar.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.od-bar.two a { height: 52px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 15px; font-weight: 600; }
.od [hidden] { display: none !important; }
.me-row[hidden] + .me-row::before { display: none; }
.me-row .me-rl { white-space: nowrap; flex: 1 0 auto; }
.me-row .me-rr { white-space: normal; text-align: right; flex: 0 1 auto; font-size: 13px; justify-content: flex-end; }
.me-row.static .me-rl { white-space: normal; flex: 1; }

/* ═════════ V11 — បានទទួល + វាយតម្លៃ (F7 · F7b) ═════════ */
.od-rcv { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.od-rcv b { font-size: 17px; font-weight: 700; }
.od-rcv small { font-size: 14px; color: var(--ink-2); margin-top: -4px; }
.od-rcv .btn-primary { margin-top: 4px; height: 52px; font-size: 17px; }
.od-stars { display: flex; gap: 4px; }
.od-stars.sm { gap: 2px; }
.od-rv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.od-rv span:first-child { display: flex; flex-direction: column; font-weight: 600; font-size: 15px; }
.od-rv small { font-weight: 400; font-size: 13px; color: var(--ink-2); }
.od-h .soft { font-weight: 600; color: #FF9500; font-size: 15px; }
.sheet-card.rs { display: flex; flex-direction: column; gap: 12px; max-height: 88vh; overflow-y: auto; }
.rs-top { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.rs-top h2, .rs-top p { margin: 0 !important; }
.rs-ok { width: 56px; height: 56px; border-radius: 28px; background: rgba(52,199,89,.14); display: grid; place-items: center; }
.rs-list { background: #fff; border-radius: 22px; box-shadow: inset 0 0 0 .5px rgba(60,60,67,.18); padding: 16px; }
.rs-list .od-sep { margin: 12px 0; }
.rs-it { display: flex; align-items: center; gap: 12px; }
.rs-it span:last-child { display: flex; flex-direction: column; }
.rs-it b { font-size: 16px; font-weight: 600; }
.rs-it small { font-size: 13px; color: var(--ink-2); }
.rs-it .od-th { width: 52px; height: 52px; }
.rs-stars { display: flex; justify-content: center; gap: 2px; margin-top: 8px; }
.rs-stars button { width: 44px; height: 44px; border: 0; background: transparent; padding: 0; display: grid; place-items: center; }
.rs .btn-primary { height: 52px; font-size: 17px; }
.rs-skip { align-self: center; min-height: 44px; color: var(--ink-2); font-size: 15px; }

/* V12 — លេខកំណែ */
.ver { font-size: 11px; letter-spacing: .04em; color: var(--ink-2); }
.me-ver { text-align: center; margin: 0 0 16px; }

/* V13 — រូប Order ពី Telegram */
button.od-ph { border: 0; padding: 0; background: transparent; font: inherit; text-align: left; cursor: zoom-in; }
.od-viewer { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.od-viewer[hidden] { display: none; }
.od-viewer img { max-width: 100%; max-height: 82vh; border-radius: 12px; }
.od-viewer span { color: rgba(255,255,255,.7); font-size: 13px; }
/* V14 — កែ: class "done" របស់ទំព័របញ្ជាទិញ (text-align:center) ប៉ះជំហានស្ថានភាព */
.od-tl li.done { text-align: left; }

/* ═════════ V15 — ដំណឹង Realtime ═════════ */
.live-toasts { position: fixed; left: 0; right: 0; top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.live-toast { pointer-events: auto; width: 100%; max-width: 460px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); box-shadow: 0 10px 30px rgba(20,20,20,.18); color: var(--ink); text-decoration: none; font-size: 14px; transform: translateY(-16px); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
.live-toast.in { transform: none; opacity: 1; }
.lt-dot { width: 10px; height: 10px; border-radius: 5px; background: #34C759; flex: none; box-shadow: 0 0 0 4px rgba(52,199,89,.18); }
.lt-t { flex: 1; min-width: 0; }
.lt-a { color: var(--blue); font-weight: 600; white-space: nowrap; }
.ok-text { color: #248A3D; }

/* V17 — ប៊ូតុង "បានទទួល" មុនដល់ម៉ោង */
.od-rcv.locked .btn-primary:disabled { opacity: .45; }
.vet-hint { font-size: 12px; color: var(--muted, #6b7280); margin: -4px 2px 4px; }
/* V20 — ប្រអប់ជ្រើសសាខាវីរៈប៊ុនថាំ (ចុច → បញ្ជីចុះក្រោម + ស្វែងរក) */
.vpick { position: relative; }
.vpick-btn {
  width: 100%; min-height: 48px; padding: 10px 40px 10px 14px; border-radius: var(--r-btn); font: inherit; font-size: 16px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); text-align: left; position: relative; cursor: pointer;
}
.vpick-btn b { font-weight: 400; display: block; }
.vpick-btn.ph b { color: var(--ink-2); }
.vpick-btn i { position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); transition: transform .15s; }
.vpick-btn.open { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.vpick-btn.open i { transform: rotate(-135deg); margin-top: -2px; }
.vpick-btn:disabled { background: rgba(118,118,128,.06); color: var(--ink-2); cursor: default; }
.vpick-pop { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r-btn); background: #fff; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.vpick-pop[hidden] { display: none; }
.fld .vpick-pop input { width: 100%; height: 44px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.vpick-list { list-style: none; margin: 0; padding: 4px 0; max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.vpick-list li { padding: 11px 14px; font-size: 15px; cursor: pointer; }
.vpick-list li + li { border-top: .5px solid var(--line); }
.vpick-list li:hover { background: var(--blue-tint); }
.vpick-list li.on { color: var(--blue); font-weight: 600; background: var(--blue-tint); }
.vpick-list li.none { color: var(--ink-2); cursor: default; background: none; }
.fld .vpick-pop input:focus { box-shadow: none; border-bottom-color: var(--blue); }
/* V21 — Tab bar ខាងក្រោម */
body.has-tabs { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.82);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  border-top: .5px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; font-size: 11px; color: var(--ink-2); text-decoration: none; }
.tab-ic { position: relative; display: inline-flex; }
.tab.on { color: var(--blue); font-weight: 600; }
.tab .cart-n { position: absolute; top: -4px; right: -10px; }
.tab:active { opacity: .6; }
@media (min-width: 700px) {
  .tabbar { left: 50%; right: auto; width: 620px; transform: translateX(-50%); border-radius: 20px 20px 0 0; }
}
.me-ic.tg { background: rgba(34,158,217,.12); color: #229ED9; }
[data-tg] .me-rl { min-width: 0; display: flex; flex-direction: column; text-align: left; }
[data-tg] .me-rl small { display: block; white-space: normal; }
[data-tg] .me-rr { flex: none; white-space: nowrap; }
/* V22 — F7a: រក្សាទុក Order កុំឲ្យបាត់ */
.od-save { display: flex; flex-direction: column; gap: 10px; }
.od-save-h { display: flex; flex-direction: column; gap: 2px; }
.od-save-h b { font-size: 17px; }
.od-save-h small { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.btn-tg { height: 52px; border-radius: 12px; border: 0; width: 100%; cursor: pointer;
  background: linear-gradient(180deg, #34AAE6 0%, #229ED9 100%); box-shadow: 0 6px 16px rgba(34,158,217,.3);
  color: #fff; font: inherit; font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-tg:disabled { opacity: .7; }
.od-save-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.od-save-2 .btn-gray { height: 46px; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; color: var(--blue); }
.od-save-ok { margin: 0; font-size: 13px; color: #1f9d55; text-align: center; }
