/* app.css: ProShip บอท. One token set, light + dark (prefers-color-scheme, or data-theme on <html>).
   Spacing on an 8 px scale, 12 px radius, one shadow token. Headings Cera Pro, body a Thai-capable system stack. */
@font-face { font-family: "CeraPro"; src: url("fonts/cerapro-medium-webfont.woff2") format("woff2"); font-display: swap; }

:root {
  color-scheme: light;
  --page: #EEF1F8; --surface: #fff; --surface-2: #f3f5fa; --strip: #F5F5F5; --ink: #1d2733; --mute: #566170; --line: #dde2ec;
  --accent: #0C6CCB; --accent-ink: #fff; --accent-soft: rgba(12,108,203,.10);
  --rise: #17773a; --fall: #c62828; --warn: #8a5300;
  --good-bg: #e3f4e8; --bad-bg: #fdeaea; --mute-bg: #e9edf4;
  --fb-bubble: #F0F2F5; --fb-meta: #65676B; --m-av: #c9ccd1; --m-av-ink: #1f2933; --m-mat: #e4e8f0;
  --bar-bg: rgba(255,255,255,.88); --av-border: 0;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 2px 8px rgba(16,24,40,.06);
  --r: 12px;
  --display: "CeraPro", "Noto Sans Thai", "Sukhumvit Set", "Thonburi", "Leelawadee UI", system-ui, sans-serif;
  --ui: "Noto Sans Thai UI", "Noto Sans Thai", "Sukhumvit Set", "Thonburi", "Leelawadee UI", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #181b20; --surface: #23272d; --surface-2: #1d2024; --strip: #1d2024; --ink: #f0f2f5; --mute: #b7bdc6; --line: #3c424a;
  --accent: #6CB6FF; --accent-ink: #10202f; --accent-soft: rgba(108,182,255,.16);
  --rise: #86d99a; --fall: #f4a3a3; --warn: #f2b45c;
  --good-bg: #1b3a21; --bad-bg: #4f2424; --mute-bg: #323841;
  --fb-bubble: #3A3B3C; --fb-meta: #B0B3B8; --m-av: #5a5c5e; --m-av-ink: #f1f1f1; --m-mat: #1d2024;
  --bar-bg: rgba(35,39,45,.88); --av-border: 1px solid #5b626c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #181b20; --surface: #23272d; --surface-2: #1d2024; --strip: #1d2024; --ink: #f0f2f5; --mute: #b7bdc6; --line: #3c424a;
    --accent: #6CB6FF; --accent-ink: #10202f; --accent-soft: rgba(108,182,255,.16);
    --rise: #86d99a; --fall: #f4a3a3; --warn: #f2b45c;
    --good-bg: #1b3a21; --bad-bg: #4f2424; --mute-bg: #323841;
    --fb-bubble: #3A3B3C; --fb-meta: #B0B3B8; --m-av: #5a5c5e; --m-av-ink: #f1f1f1; --m-mat: #1d2024;
    --bar-bg: rgba(35,39,45,.88); --av-border: 1px solid #5b626c;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 16px/1.5 var(--ui); min-height: 100vh; }
body.lock { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p, dl, dd, ul { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mute { color: var(--mute); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { font-weight: 400; font-size: 13px; color: var(--mute); }

/* ── top bar ── */
.top { position: sticky; top: 0; z-index: 40; background: var(--bar-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; }
.sp { flex: 1 1 auto; }
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand img { border-radius: 8px; }
.brand b, .wmk b { font: 700 20px var(--display); letter-spacing: -.01em; }
.brand span, .wmk span { font-size: 15px; }
.burger { width: 44px; height: 44px; margin-left: -8px; border: 0; background: transparent; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.seller { font-size: 15px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.selav { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
@media (max-width: 719px) { .pillwrap { display: none; } .seller { display: none; } }
@media (min-width: 1000px) {
  body.has-nav .top { margin-left: 240px; }
  body.has-nav .burger, body.has-nav .brand { display: none; }
  body.has-nav #view { margin-left: 240px; }
}

/* ── left nav ── */
.nav { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: 240px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.nav[hidden] { display: none; }
.nav-head { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.nav-head img { border-radius: 8px; }
.wmk { display: flex; align-items: baseline; gap: 8px; }
.nav-list { flex: 1 1 auto; overflow-y: auto; padding: 16px 8px; display: flex; flex-direction: column; gap: 4px; }
.nav-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-weight: 600; text-align: left; }
.nav-row:hover { background: var(--accent-soft); }
.nav-row.is-on { background: var(--accent); color: var(--accent-ink); }
.nav-row .ico { flex: none; }
.nav-row .nl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-row .chip { background: var(--mute-bg); color: var(--mute); }
.nav-grp { margin: 16px 12px 4px; font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.nav-foot { flex: none; padding: 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.nav-help { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--mute); font-weight: 600; }
.nav-help:hover { background: var(--accent-soft); }
.nav-foot .btn2 { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ver { text-align: center; font-size: 12px; color: var(--mute); }
#navscrim { display: none; }
@media (max-width: 999px) {
  .nav { width: min(80vw, 320px); transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility 0s .2s; box-shadow: var(--shadow); }
  body.nav-open .nav { transform: none; visibility: visible; transition: transform .2s; }
  body.nav-open #navscrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15,23,30,.5); border: 0; }
}

/* ── screens ── */
#view { padding-bottom: 80px; }
.scr { max-width: 1040px; margin: 0; padding: 24px 24px 32px; }
.scr.center { margin: 0 auto; max-width: 640px; }
.scr.wide { max-width: 1040px; }
@media (max-width: 719px) { .scr { padding: 16px 16px 24px; } }
.crumb { display: flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 0 8px -12px; }
.crumb-t { font-size: 14px; color: var(--mute); }
.crumb.in-sheet { margin: 0 0 4px -12px; }
.back { width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent; color: var(--accent); font-size: 32px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hdr { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hdr-t { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.h { font: 700 28px/1.3 var(--display); }
.bar { color: var(--line); font-size: 20px; }
.instr { font-size: 15px; color: var(--mute); }
.meta { font-size: 14px; margin-top: 4px; }
.first { font-size: 15px; margin: 0 0 16px; color: var(--mute); }
.why { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.why-t { flex: 1 1 auto; font-size: 14px; line-height: 1.5; color: var(--mute); }
.why-b { flex: none; min-height: 44px; min-width: 56px; padding: 0 2px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; }
.why-b span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1.5px solid var(--accent); border-radius: 999px; font: 600 13px var(--ui); color: var(--accent); white-space: nowrap; }
.samp { margin: 16px 0 8px; font-size: 13px; color: var(--mute); }
.gatepic { margin: 16px 0; padding: 16px; background: var(--m-mat); border-radius: var(--r); overflow: hidden; }
.gatepic.flat { margin: 0; }
.gatepic .sep { height: 1px; background: var(--line); margin: 12px 0; }
.dim60 { opacity: .6; }
@media (max-width: 719px) { .hdr { flex-direction: column-reverse; align-items: stretch; gap: 8px; } .bar { display: none; } .hdr-t { flex-direction: column; gap: 4px; } .h { font-size: 24px; } }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-top: 16px; overflow: hidden; }
.strip { background: var(--strip); padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--line); }
.strip-flex { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.cbody { padding: 16px; }
.two-cards { display: grid; gap: 0; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .two-cards { grid-template-columns: 1fr 1fr; gap: 16px; } }
.fixed { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; font-size: 13px; color: var(--mute); }
.fixed .ico { flex: none; color: var(--rise); }
.l1 { display: grid; gap: 24px; grid-template-columns: 1fr; margin-top: 8px; }
.l1-card { margin-top: 0; padding: 24px; }
.l1-hero { order: -1; display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--r); }
@media (min-width: 900px) { .l1 { grid-template-columns: 1fr 1fr; align-items: stretch; } .l1-hero { order: 0; max-height: none; height: 100%; min-height: 480px; } }
.empty-card { padding: 24px; text-align: left; }
.empty-card .strip { margin: -24px -24px 16px; }
.empty-card .cbody { padding: 0; }
.empty-card p { margin-bottom: 16px; }
.empty-box { grid-column: 1 / -1; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.empty-box p { margin-bottom: 16px; color: var(--mute); }
.empty { margin: 16px 0; color: var(--mute); }

/* buttons */
.btn { display: block; text-align: center; line-height: 1.35; width: 100%; min-height: 48px; padding: 12px 24px; border: 0; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); font: 600 16px var(--ui); }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { background: var(--mute-bg); color: var(--mute); cursor: not-allowed; filter: none; }
.btn.is-inline { display: inline-block; width: auto; min-height: 44px; padding: 10px 16px; }
.btn2 { display: inline-block; text-align: center; line-height: 1.3; width: 100%; min-height: 44px; padding: 10px 16px; border: 1.5px solid var(--accent); border-radius: var(--r); background: transparent; color: var(--accent); font: 600 15px var(--ui); }
.btn2.is-fall { border-color: var(--fall); color: var(--fall); }
.btn2.is-small { width: auto; font-size: 14px; }
.btns { display: grid; gap: 8px; margin-top: 16px; }
.cta { margin-top: 24px; }
@media (min-width: 720px) { .cta .btn { width: auto; min-width: 240px; } .cta.is-sticky .btns .btn, .cta.is-sticky .btns .btn2 { width: auto; min-width: 240px; justify-self: start; } .add-d { display: inline-block; } }
@media (max-width: 719px) {
  .cta.is-sticky { position: sticky; bottom: 0; margin: 24px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); z-index: 5; }
  .btn.add-d { display: none; }
}
@media (min-width: 720px) { .cta.is-sticky .btn { width: auto; } .cta.phone-only { display: none; } }

/* pill + popover */
.pillwrap { position: relative; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rise); display: inline-block; }
.pop { position: absolute; right: 0; top: 52px; z-index: 30; width: 300px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pop[hidden] { display: none; }
.pop-f > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
.pop-f dd { text-align: right; font-weight: 600; }
.pop .btn { min-height: 44px; font-size: 15px; margin-top: 8px; }

/* page button */
.pgbtn { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 8px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); text-align: left; min-width: 0; max-width: 100%; }
.pgbtn:hover { border-color: var(--accent); }
.pgbtn .nm { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 15px; }
.pgbtn svg { flex: none; color: var(--mute); }
.av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; object-fit: cover; }
img.av { border: var(--av-border); }
@media (max-width: 719px) { .pgbtn { width: 100%; } }

/* cards (Q) */
.cards { display: grid; gap: 16px; margin-top: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards.is-two { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .cards.is-three { grid-template-columns: repeat(3, 1fr); } }
.mcard { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); text-align: left; color: var(--ink); }
.mcard:hover { border-color: var(--accent); }
.mcard.is-dim .mat { opacity: .6; }
.mcard.is-dim .lt { color: var(--mute); }
.stopcard { margin-top: 16px; }
.mat { position: relative; overflow: hidden; max-height: 168px; background: var(--m-mat); border-radius: 8px; padding: 8px; text-align: left; }
.mat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: linear-gradient(to bottom, transparent, var(--m-mat)); pointer-events: none; }
.line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lt { font-size: 15px; font-weight: 600; min-width: 0; }
.cn { display: flex; align-items: baseline; gap: 4px; flex: none; }
.cn .n { font: 700 20px var(--mono); }
.u { font-size: 13px; color: var(--mute); }

/* tables (B1, CM4) */
.tbl { padding: 0; }
.thead, .trow { display: grid; align-items: center; column-gap: 16px; padding: 0 16px; }
.thead { min-height: 40px; font-size: 13px; font-weight: 600; color: var(--mute); border-bottom: 1px solid var(--line); background: var(--surface); }
.trow { width: 100%; min-height: 56px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; color: var(--ink); }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--accent-soft); }
.trow.is-dim { opacity: .6; }
.tbl-bot .thead, .tbl-bot .trow { grid-template-columns: 32px minmax(0, 1fr) minmax(0, 2fr) 96px; }
.tbl-posts .thead, .tbl-posts .trow { grid-template-columns: 32px 128px minmax(0, 1fr) 128px 96px; }
.tbl .strip-flex { border-bottom: 1px solid var(--line); }
.c-n { color: var(--mute); }
.c-w b { font-weight: 700; overflow-wrap: anywhere; }
.c-r { display: flex; align-items: center; gap: 8px; min-width: 0; }
.c-rb { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.tbl-bot .c-rt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-rt, .c-pt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--mute); }
.c-pt { color: var(--ink); }
.c-p { display: flex; align-items: center; gap: 12px; min-width: 0; }
.c-d { font-size: 14px; color: var(--mute); }
.c-c { text-align: right; white-space: nowrap; font-weight: 600; }
.c-c .n { font-family: var(--mono); font-weight: 700; }
.c-c small { display: none; font-size: 13px; color: var(--mute); margin-left: 4px; font-weight: 400; }
.thead .c-c { font-weight: 600; }
.th { width: 40px; height: 40px; flex: none; border-radius: 8px; overflow: hidden; background: var(--mute-bg); display: inline-flex; }
.th.is-s { width: 32px; height: 32px; }
.th img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 719px) {
  .tbl-bot .thead { grid-template-columns: minmax(0, 1fr) auto; } .tbl-bot .thead > :nth-child(1), .tbl-bot .thead .hc-x { display: none; }
  .tbl-posts .thead { display: none; }
  .tbl-bot .trow { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "n w c" ". r r"; row-gap: 4px; padding: 12px 16px; }
  .tbl-posts .trow { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "n p c" ". d s"; row-gap: 4px; padding: 12px 16px; }
  .c-n { grid-area: n; } .c-w { grid-area: w; } .c-r { grid-area: r; } .c-s { grid-area: s; } .c-c { grid-area: c; } .c-p { grid-area: p; } .c-d { grid-area: d; }
  .c-s:empty { display: none; } .c-c small { display: inline; }
}
.chip { display: inline-block; max-width: 148px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--mute-bg); color: var(--mute); }
.chip.is-good { background: var(--good-bg); color: var(--rise); }
.chip.is-bad { background: var(--bad-bg); color: var(--fall); }
.chip.is-acc { background: var(--accent-soft); color: var(--accent); }

/* switch card */
.feat-wrap { padding: 8px 16px 8px; }
.feat { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.feat .ft { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.feat .ft b { font-size: 16px; font-weight: 600; }
.feat .ft span { font-size: 14px; color: var(--mute); }
.sw { flex: none; position: relative; width: 56px; height: 44px; border: 0; background: transparent; padding: 0; }
.sw::before { content: ""; position: absolute; left: 0; top: 8px; width: 56px; height: 28px; border-radius: 14px; background: #b9c0cc; }
.sw[aria-checked="true"]::before { background: var(--accent); }
.sw i { position: absolute; left: 3px; top: 11px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .15s; }
.sw[aria-checked="true"] i { transform: translateX(28px); }
.feat-wrap .why { margin-top: 0; padding-top: 4px; border-top: 1px solid var(--line); }
.fine { margin-top: 12px; font-size: 13px; color: var(--mute); }

/* forms */
.fld { margin-top: 24px; }
.cbody > .fld:first-child { margin-top: 0; }
.fld > label, .fld .lab { display: block; font-weight: 600; font-size: 16px; }
.fld .help { margin: 4px 0 8px; font-size: 13px; color: var(--mute); }
.in, .ta { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: 16px/1.5 var(--ui); }
.ta { min-height: 96px; resize: vertical; }
.in:focus, .ta:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.pwrap { position: relative; }
.pwrap .in { padding-right: 52px; }
.eye { position: absolute; right: 0; top: 0; width: 48px; height: 44px; border: 0; background: transparent; color: var(--mute); display: inline-flex; align-items: center; justify-content: center; }
.frow { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; font-size: 12px; color: var(--mute); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.errl { margin-top: 8px; font-size: 14px; color: var(--fall); }
.imgrow { display: flex; align-items: center; gap: 12px; }
.imgrow img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; }
.imgrow .btn2 { width: auto; }
.pv { margin-top: 16px; }
.pv .lab { font-weight: 600; display: block; margin-bottom: 8px; }
.cbody > .pv:first-child { margin-top: 0; }
.cbody .fld + .pv { margin-top: 24px; }

/* order meter */
.meter { padding: 4px 0; }
.meter-bar { height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; border: 1px solid var(--line); }
.meter-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter-n { display: flex; justify-content: space-between; margin-top: 8px; font-size: 14px; }
.meter-l { margin-top: 8px; font-size: 16px; }

/* layer: bottom sheet on a phone, centred modal from 720 */
.layer { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(15,23,30,.5); }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); outline: none; }
@media (min-width: 720px) { .layer { align-items: center; } .sheet { border-radius: 16px; max-height: 86vh; padding: 16px 24px 24px; box-shadow: var(--shadow); } }
.grab { display: block; width: 64px; height: 44px; margin: -8px auto -16px; border: 0; background: transparent; position: relative; padding: 0; }
.grab::after { content: ""; position: absolute; left: 10px; right: 10px; top: 20px; height: 4px; border-radius: 2px; background: var(--line); }
.st { font: 700 22px/1.3 var(--display); margin: 4px 0 4px; overflow-wrap: anywhere; }
.sheet .meta { margin-bottom: 4px; }
.sheet .instr { margin-top: 4px; }
.pic { margin: 16px 0; padding: 16px; background: var(--m-mat); border-radius: var(--r); overflow: hidden; }
.facts { margin: 0 0 16px; }
.fact { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.fact:last-child { border-bottom: 0; }
.fact dt { color: var(--mute); flex: none; }
.fact dd { text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.why-l { list-style: none; margin: 8px 0 16px; display: grid; gap: 12px; }
.why-l li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.5; }
.why-dot { flex: none; width: 8px; height: 8px; margin-top: 10px; border-radius: 50%; background: var(--accent); }
.pcards { display: grid; gap: 8px; margin-top: 16px; }
.pcards.is-grid { gap: 16px; }
@media (min-width: 900px) { .pcards.is-grid { grid-template-columns: 1fr 1fr; } }
.pcard { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); text-align: left; color: var(--ink); }
.pcard:hover { border-color: var(--accent); }
.pcard .av { width: 36px; height: 36px; font-size: 15px; }
.pcard .pt { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pcard .pt .pn { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.pcard .pt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pcard .pt .pl { font-size: 13px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pc { font-family: var(--mono); font-weight: 700; white-space: nowrap; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.pcard .pc small { font: 400 12px var(--ui); color: var(--mute); }
.search { margin-top: 16px; }

/* materials (Facebook / Messenger as the seller sees them) */
.m-z-card { font-size: 13px; line-height: 1.4; }
.m-z-sheet { font-size: 15px; line-height: 1.45; }
.m-row { display: flex; gap: 8px; align-items: flex-start; }
.m-row.is-reply { margin: 8px 0 0 40px; }
.m-col { display: flex; flex-direction: column; min-width: 0; }
.m-av { flex: none; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--m-av); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--m-av-ink); }
.m-av.is-page { background: var(--accent); color: var(--accent-ink); }
.m-av.is-s { width: 24px; height: 24px; font-size: 12px; }
.m-z-card .m-av { width: 28px; height: 28px; font-size: 13px; } .m-z-card .m-av.is-s { width: 22px; height: 22px; font-size: 11px; }
.m-z-card .m-row.is-reply { margin-left: 36px; margin-top: 4px; }
.m-bub { display: inline-block; align-self: flex-start; max-width: 100%; padding: 6px 12px; border-radius: 18px; background: var(--fb-bubble); overflow-wrap: anywhere; color: var(--ink); }
.m-bub b { display: block; font-weight: 700; }
.m-z-card .m-bub b { display: inline; margin-right: 6px; }
.m-z-card .m-bub { padding: 4px 10px; }
.m-bub.is-hid { opacity: .45; }
.m-bub.is-dash, .m-mb.is-dash { background: var(--fb-bubble); border: 0; }
.m-bub.is-dash .m-ph, .m-mb.is-dash .m-ph { font-style: italic; }
.m-meta { font-size: 12px; padding-left: 12px; color: var(--fb-meta); }
.m-meta.is-rise { color: var(--rise); } .m-meta.is-acc { color: var(--accent); } .m-meta.is-fall { color: var(--fall); }
.m-ph { color: var(--fb-meta); }
.m-msg { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; }
.m-z-card .m-msg { margin-top: 6px; }
.m-msg.is-buyer { justify-content: flex-end; }
.m-msg .m-col { max-width: 260px; }
.m-z-card .m-msg .m-col { max-width: none; }
.m-msg.is-buyer .m-col { align-items: flex-end; }
.m-mb { padding: 8px 12px; border-radius: 18px; background: var(--fb-bubble); overflow-wrap: anywhere; white-space: pre-line; color: var(--ink); }
.m-z-card .m-mb { padding: 5px 10px; line-height: 1.3; }
.m-msg.is-buyer .m-mb { background: var(--accent); color: var(--accent-ink); }
.m-mb.is-img { padding: 4px; }
.m-mb-img { display: block; width: 160px; max-width: 100%; border-radius: 12px; }
.m-z-card .m-mb-img { width: 120px; }
.m-mb:not(.is-img) .m-mb-img { margin-bottom: 6px; }
.m-pills { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.m-pills span { padding: 2px 12px; border: 1.5px solid var(--accent); border-radius: 999px; font-weight: 600; color: var(--accent); background: var(--surface); }
.m-post { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.m-ph-head { display: flex; gap: 8px; align-items: center; padding: 8px 10px 0; }
.m-ph-head b { font-weight: 700; display: block; }
.m-pt { margin: 6px 10px 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-pimg { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.m-stack { display: block; }
.m-bglyph { color: var(--mute); }


img.m-av { border: var(--av-border); }

/* toast */
#toasts { position: fixed; z-index: 10000; right: 24px; bottom: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
body.dev #toasts { bottom: 72px; }
.toast { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--rise); border-radius: var(--r); box-shadow: var(--shadow); font-size: 15px; font-weight: 600; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); }
.toast .ico { color: var(--rise); flex: none; }
.toast.in { opacity: 1; transform: none; }
@media (max-width: 719px) { #toasts { left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); align-items: stretch; } body.dev #toasts { bottom: calc(136px + env(safe-area-inset-bottom)); } }

/* loading skeleton */
.skel { border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shim 1.2s linear infinite; }
@keyframes shim { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .sw i, .toast, .nav { transition: none; } }

/* developer switch (#dev) */
.st-wrap { position: fixed; right: 12px; bottom: 12px; z-index: 1500; }
.st-b { min-height: 44px; padding: 0 16px; border: 1.5px solid var(--accent); border-radius: var(--r); background: var(--surface); color: var(--accent); font: 600 13px var(--ui); box-shadow: var(--shadow); }
.st-list { position: absolute; right: 0; bottom: 52px; width: 240px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: grid; gap: 4px; }
.st-list[hidden] { display: none; }
.st-list button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: 15px; color: var(--ink); }
.st-list button:hover { background: var(--accent-soft); }
@media (max-width: 719px) { body.has-cta .st-wrap { bottom: 84px; } }

/* review fixes */
.help-l { font-size: 13px; color: var(--mute); text-align: center; }
.help-l[hidden] { display: none; }
.btns .btn2.is-small { justify-self: start; }
.lt-w { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.ls { font-size: 13px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.mcard.is-off { border-style: dashed; border-color: var(--mute); }
.del-wrap { margin-top: 24px; }
.imgrow { flex-wrap: wrap; }

/* connect Pages (P1) */
@media (max-width: 719px) { .btn.hdr-act { display: none; } }
.cblist { display: grid; gap: 8px; margin: 16px 0; }
.cbrow { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.cbrow input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cbox { flex: none; width: 24px; height: 24px; border: 2px solid var(--mute); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.cbrow input:checked + .cbox { background: var(--accent); border-color: var(--accent); }
.cbrow input:checked + .cbox::after { content: ""; width: 6px; height: 11px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.cbrow:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.cbn { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.st-t { display: inline-flex; align-items: center; gap: 12px; }
.st-t .av { width: 36px; height: 36px; }
.pg-off { margin-top: 12px; }
.pg-off:disabled { opacity: .5; cursor: not-allowed; }

/* CM5: pick one chat message */
.pick2 { display: grid; gap: 8px; grid-template-columns: 1fr; margin-top: 4px; }
@media (min-width: 560px) { .pick2 { grid-template-columns: 1fr 1fr; } }
.opt { border: 1.5px solid var(--line); border-radius: var(--r); padding: 8px; background: var(--surface); }
.opt:has(.opt-h[aria-checked="true"]) { border-color: var(--accent); background: var(--accent-soft); }
.opt.is-off { opacity: .55; }
.opt-h { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 4px; border: 0; background: transparent; font-weight: 600; text-align: left; }
.opt-h::before, .opt-none::before { content: ""; flex: none; width: 18px; height: 18px; border: 2px solid var(--mute); border-radius: 50%; }
.opt-h[aria-checked="true"]::before, .opt-none[aria-checked="true"]::before { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.opt-none { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; width: auto; }
.opt-none[aria-checked="true"] { background: var(--accent-soft); }
.opt .imgrow { flex-wrap: wrap; }
.opt .ta { min-height: 88px; }
