/* ============================================================
   ChatBaaz design system — flat, WhatsApp deep-green SaaS
   Tokens: white/neutral surfaces, no gradients, restrained shadow
   ============================================================ */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f9f8;
  --bg-softer: #eef4f2;
  --ink: #1f2937;
  --ink-soft: #374151;
  --muted: #5f6b66;
  --line: #e3eae8;
  --line-soft: #eef2f1;
  --brand: #128c7e;
  --brand-dark: #075e54;
  --brand-ink: #0b4f47;
  --brand-soft: #e6f4f1;
  --brand-line: #bfe3dc;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;
  /* Ad-source badge colours (migration 107, 2026-11-22) — each
     platform's brand colours, tokenised so no hex appears outside
     :root (design-system rule). */
  --ad-fb-bg: #e7f0fe;
  --ad-fb-border: #bcd3f7;
  --ad-fb: #1877f2;
  --ad-ig-1: #f09433;
  --ad-ig-2: #e6683c;
  --ad-ig-3: #dc2743;
  --ad-ig-4: #cc2366;
  --ad-ig-5: #bc1888;
  --ad-tt-bg: #111111;
  --ad-tt: #25f4ee;
  --ad-go-bg: #e8f0fe;
  --ad-go-border: #aecbfa;
  --ad-go: #1a73e8;
  --ad-wa-bg: #dcf8e7;
  --ad-wa-border: #a8e6c3;
  --ad-wa: #128c4a;
  --ad-me-bg: #eef2f7;
  --ad-me-border: #cbd5e1;
  --ad-me: #475569;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 12px rgba(16, 24, 20, .06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 20, .08);
  --sidebar-w: 232px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", "Hind Siliguri", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-soft);
  line-height: 1.6;
  font-size: 15px;
}
body.landing { background: var(--bg); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.2rem; margin-top: 1.6em; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em;
  background: var(--bg-softer);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .85rem; }

/* ---------- SVG icons ---------- */
.ic {
  width: 1.2em; height: 1.2em;
  vertical-align: -0.22em;
  flex-shrink: 0;
}
.ic.sm { width: 1em; height: 1em; }
.ic.invalid { color: var(--red); }
.pill-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pill-dot.wa { background: #25d366; }
.pill-dot.msgr { background: #0084ff; }
.ic.lg { width: 1.7em; height: 1.7em; }
.icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  flex-shrink: 0;
}
.icon-wrap .ic { width: 22px; height: 22px; }
.icon-wrap.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-wrap.sm .ic { width: 17px; height: 17px; }
.icon-wrap.lg { width: 52px; height: 52px; border-radius: 14px; }
.icon-wrap.lg .ic { width: 27px; height: 27px; }
.icon-wrap.neutral { background: var(--bg-softer); border-color: var(--line); color: var(--ink-soft); }
.icon-wrap.red { background: var(--red-soft); border-color: #f3c2c2; color: var(--red); }

/* ---------- Layout: app shell ---------- */
.page {
  padding: 20px 16px 96px;
  min-width: 0;
}
/* Full-width pages (chat layouts should use all available space) */
.page.inbox-page { max-width: none; }
/* Inbox: hidden attribute must always win over component display rules */
.page.inbox-page [hidden] { display: none !important; }
.page-head {
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 18px;
}
.page-head.compact { gap: 10px; align-items: center; margin-bottom: 14px; }
.page-head.compact h1 { font-size: 1.1rem; }
/* Dashboard recent conversations — mobile-friendly list */
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.recent-item:hover { text-decoration: none; border-color: var(--brand-line); background: var(--brand-soft); }
.recent-body { min-width: 0; flex: 1; }
.recent-top { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.recent-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.recent-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; color: var(--muted); }
.page-head h1 { margin: 0; font-size: 1.45rem; }
.page-head h2 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.page-head { flex-wrap: wrap; }
.page-sub { color: var(--muted); margin: 4px 0 0; font-size: .93rem; }

/* topbar (mobile) */
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  align-items: center; justify-content: space-between;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.plan-badge {
  font-size: .72rem; font-weight: 700; color: var(--brand-dark);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.profile-wrap { position: relative; }
.profile-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.profile-btn .avatar { cursor: pointer; }
.profile-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 220px; overflow: hidden;
}
.profile-menu-head { display: flex; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line-soft); }
.profile-menu-head strong { display: block; font-size: .92rem; }
.profile-menu-head small { display: block; }
.profile-menu a, .profile-menu form button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; color: var(--ink); font-size: .9rem; font-weight: 500;
  border: 0; background: none; cursor: pointer; text-align: left; font-family: inherit;
}
.profile-menu a:hover, .profile-menu form button:hover { background: var(--bg-soft); text-decoration: none; }

/* sidebar (desktop) */
.sidebar {
  display: none;
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  overflow-y: auto;
  z-index: 40;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar .brand { margin: 2px 8px 14px; }
.nav-label {
  font-size: .72rem; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 14px 10px 6px;
}
.sidebar a.navlink {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-weight: 500; font-size: .93rem;
}
.sidebar a.navlink:hover { background: var(--bg-soft); text-decoration: none; }
.sidebar a.navlink.on {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}
.sidebar a.navlink .ic { color: var(--muted); }
.sidebar a.navlink.on .ic { color: var(--brand-dark); }
.nav-logout { margin-top: 10px; padding: 0 4px; }
.nav-logout button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  background: none; border: 0; border-radius: var(--r-sm);
  color: var(--muted); font: inherit; font-size: .93rem; cursor: pointer;
}
.nav-logout button:hover { background: var(--red-soft); color: var(--red); }

/* bottomnav (mobile) - dynamic pill design */
/* OLD BOTTOMNAV - replaced by bubble design below
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  gap: 2px;
}
.bottomnav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 6px;
  color: var(--muted); font-size: .68rem; font-weight: 500;
  border-radius: 14px;
  transition: all .2s ease;
  position: relative;
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav a .ic {
  width: 24px; height: 24px;
  transition: transform .2s ease;
}
.bottomnav a small { font-size: .68rem; transition: all .2s ease; }
.bottomnav a.on {
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  font-weight: 700;
}
.bottomnav a.on .ic {
  transform: scale(1.15);
  color: var(--brand);
}
.bottomnav a.on::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--brand);
}
.bottomnav a:active { transform: scale(.96); }
END OLD */

/* brand */
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink); font-weight: 800; font-size: 1.15rem;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--brand);
  color: #fff;
  border-radius: 9px;
}
.brand-mark .ic { width: 19px; height: 19px; }

/* ---------- Cards, grids ---------- */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 16px;
}
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (max-width: 899px) {
  /* Compact all page headers on mobile */
  .page-head { gap: 10px; align-items: center; margin-bottom: 14px; }
  .page-head h1 { font-size: 1.15rem; }
  .page-head h2 { font-size: 1.05rem; }
  .page-head .page-sub { font-size: .82rem; margin-top: 2px; }
  .page-head .icon-wrap.lg { width: 40px; height: 40px; }
  .page-head .icon-wrap.lg .ic { width: 20px; height: 20px; }
  .page-head .icon-wrap { width: 36px; height: 36px; }
  .page-head .icon-wrap .ic { width: 18px; height: 18px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  /* Header action buttons: full-width thumb-friendly row on mobile */
  .page-head-actions { display: flex; gap: 8px; flex: 1 1 100%; }
  .page-head-actions .btn { flex: 1; justify-content: center; }
}
.cards.two { grid-template-columns: 1fr; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.card-head h3 { margin: 0; }
.empty {
  text-align: center;
  padding: 36px 20px;
  border-style: dashed;
  box-shadow: none;
  background: var(--bg);
}
.empty .icon-wrap { margin-bottom: 10px; }
.empty p { color: var(--muted); margin: 8px 0 14px; }
/* Plain empty state for use inside cards/lists (no double border) */
.empty.plain { border: 0; box-shadow: none; background: transparent; padding: 28px 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-outline, .btn-ghost {
  background: var(--bg);
  color: var(--brand-dark);
  border: 1px solid var(--brand-line);
}
.btn-outline:hover, .btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.btn-danger { background: var(--bg); color: var(--red); border: 1px solid #f0b9b9; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 13px 26px; font-size: 1.02rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
.field > input, .field > select, .field > textarea,
.field input, .field select, .field textarea {
  display: block; width: 100%;
  margin-top: 6px;
  font: inherit; font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--brand-line);
  outline-offset: 0;
  border-color: var(--brand);
}
.field small, small.muted { font-weight: 400; color: var(--muted); }
.check {
  display: flex !important; align-items: flex-start; gap: 9px;
  font-weight: 400; margin-top: 8px; cursor: pointer;
}
.check input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--brand-dark); flex-shrink: 0; }
input[type="range"] { accent-color: var(--brand-dark); }
.inline { display: inline; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table thead th {
  background: var(--bg-soft);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-soft); }

/* ---------- Pills, alerts, bars ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .76rem; font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-softer);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}
.pill.ok { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.pill.warn { background: var(--amber-soft); border-color: #f0dcae; color: var(--amber); }
.pill.bad { background: var(--red-soft); border-color: #f3c2c2; color: var(--red); }
.pill.info { background: var(--blue-soft); border-color: #bcd3f7; color: var(--blue); }
.pill.off { background: var(--bg-soft); color: var(--muted); }

.alert {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: .92rem;
}
.alert.err { border-left-color: var(--red); background: var(--red-soft); }
.alert.ok { border-left-color: var(--brand); }
.alert.inline { display: inline-block; margin: 0 0 0 8px; padding: 4px 10px; }

.bar { height: 10px; background: var(--bg-softer); border: 1px solid var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width .4s ease; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: var(--bg-soft);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 30px 26px;
}
.auth-card .brand { margin-bottom: 6px; }
.auth-card h1 { margin: 10px 0 4px; font-size: 1.35rem; }
.auth-tag { color: var(--muted); margin-bottom: 18px; font-size: .92rem; }
.auth-card .foot-note { margin-top: 16px; text-align: center; color: var(--muted); font-size: .9rem; }

/* ---------- Inbox ---------- */
.inbox-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.conv-list { padding: 8px; max-height: none; scrollbar-width: none; -ms-overflow-style: none; overflow-x: hidden; }
.conv-list.card { overflow: hidden; }
.conv-list::-webkit-scrollbar { display: none; }
@media (min-width: 900px) {
  .conv-list { max-height: calc(100dvh - 220px); overflow-y: auto; min-height: 0; }
}
.messages { scrollbar-width: none; -ms-overflow-style: none; }
.messages::-webkit-scrollbar { display: none; }
.conv {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 8px;
  border-radius: var(--r-sm);
  color: var(--ink);
  min-width: 0; max-width: 100%; overflow: hidden;
}
.conv .avatar { flex-shrink: 0; }
.conv .chan-ic { flex-shrink: 0; }
.conv:hover { background: var(--bg-soft); text-decoration: none; }
.conv.on { background: var(--brand-soft); }
.conv-body { min-width: 0; flex: 1; overflow: hidden; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.conv-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .94rem; min-width: 0; flex: 1; }

/* Inbox top card — search + filters */
.inbox-top {
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.fsearch-top {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 14px; padding: 5px 8px 5px 6px; margin-bottom: 10px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.fsearch-top:hover { border-color: var(--brand-line); }
.fsearch-top:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--bg); }
.fsearch-icon {
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 28px; height: 28px;
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 10px;
  transition: all .15s ease;
}
.fsearch-top:focus-within .fsearch-icon { color: var(--brand-dark); border-color: var(--brand-line); background: var(--brand-soft); }
.fsearch-top input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font: inherit; font-size: .85rem; outline: none; padding: 3px 0; color: var(--ink);
}
.fsearch-top input::placeholder { color: var(--muted); }
.fsearch-clear {
  color: var(--muted); font-size: .8rem; flex-shrink: 0;
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--line-soft);
  transition: all .15s ease;
}
.fsearch-clear:hover { text-decoration: none; color: #fff; background: var(--muted); }
.filter-row { display: flex; flex-direction: column; gap: 8px; }
.ftab, .fpill {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-soft); font-size: .85rem; font-weight: 600; background: var(--bg-soft);
  transition: all .15s ease;
}
.ftab.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.fpill.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); font-weight: 700; }
@media (max-width: 899px) {
  .page.inbox-page { overflow-x: hidden; }
  .inbox-top { padding: 10px; margin-bottom: 10px; overflow: hidden; }
  .inbox-top .ftabs, .inbox-top .fpills {
    display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none; -ms-overflow-style: none;
    max-width: 100%; min-width: 0; flex: 1 1 100%;
  }
  .inbox-top .ftabs::-webkit-scrollbar, .inbox-top .fpills::-webkit-scrollbar { display: none; }
  .inbox-top .ftab, .inbox-top .fpill { white-space: nowrap; flex-shrink: 0; padding: 6px 12px; font-size: .82rem; }
  /* Compact conversation list on mobile */
  .page.inbox-page { padding: 12px 12px 90px; overflow-x: hidden; }
  .inbox-grid { max-width: 100%; overflow: hidden; }
  .conv-list { padding: 4px; }
  .conv { padding: 10px 8px; gap: 10px; }
}
.ftabs, .fpills { display: flex; gap: 6px; flex-wrap: wrap; }
.ftab:hover, .fpill:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-dark); }
.fsearch { display: flex; gap: 6px; margin-left: auto; }
.fsearch input { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font: inherit; max-width: 200px; background: var(--bg-soft); }
.thread-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.thread-actions select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: .85rem; max-width: 170px; }
.customer-panel { display: none; }
.customer-mobile { margin-top: 12px; }
.customer-mobile summary { cursor: pointer; font-weight: 700; padding: 12px 16px; list-style: none; display: flex; align-items: center; gap: 8px; }
.customer-mobile summary::-webkit-details-marker { display: none; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.kv > span:first-child { flex-shrink: 0; }
.kv > span:last-child, .kv > strong:last-child { min-width: 0; overflow-wrap: anywhere; text-align: right; }
@media (min-width: 900px) {
  .customer-panel { display: block; }
  .customer-mobile { display: none; }
  .inbox-grid.with-panel { grid-template-columns: 280px minmax(0, 1fr); }
  .inbox-grid.with-panel .customer-panel { display: none; }
}
@media (min-width: 1280px) {
  .inbox-grid.with-panel { grid-template-columns: 300px minmax(0, 1fr) 290px; }
  .inbox-grid.with-panel .customer-panel { display: block; }
}
.desktop-only { display: none; }
@media (min-width: 900px) and (max-width: 1279px) {
  .desktop-only { display: inline-flex; }
}
  .inbox-grid.with-panel .customer-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 320px; z-index: 50;
    background: var(--bg); border-left: 1px solid var(--line);
    box-shadow: -4px 0 20px rgba(0,0,0,.1); overflow-y: auto; padding: 16px;
    transform: translateX(100%); transition: transform .25s ease;
  }
  .inbox-grid.with-panel .customer-panel.open { transform: none; }
.conv-time { flex-shrink: 0; font-size: .75rem; }
.conv-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.conv-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; min-width: 0; flex: 1; }
.unread-badge {
  flex-shrink: 0; min-width: 21px; height: 21px; padding: 0 6px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: .72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.chan-ic {
  flex-shrink: 0; font-size: .68rem; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 5px;
  align-self: flex-start;
}
/* WhatsApp-style thread polish */
.day-sep { display: flex; justify-content: center; margin: 6px 0 2px; }
.day-sep span {
  background: var(--bg-soft); border: 1px solid var(--line-soft); color: var(--muted);
  font-size: .75rem; font-weight: 600; padding: 4px 14px; border-radius: 999px;
}
.msg-time { font-size: .68rem; color: var(--muted); margin-left: 8px; white-space: nowrap; vertical-align: baseline; }
.msg-time.msg-sent, .msg-time.msg-failed { display: inline-block; width: 14px; height: 14px; background-repeat: no-repeat; background-position: center; background-size: 14px 14px; }
.msg-time.msg-sent { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); }
.msg-time.msg-failed { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.msg.out-human .msg-time { color: rgba(255,255,255,.85); }
.msg.out-ai .msg-time { color: var(--brand-dark); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  color: var(--brand-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem; flex-shrink: 0;
}
.avatar.sm { width: 36px; height: 36px; font-size: .95rem; }
.thread { display: none; flex-direction: column; min-height: 60vh; }
body.thread-open .thread { display: flex; }
body.thread-open .conv-list { display: none; }
.thread-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.th-id { min-width: 0; flex: 1; }
.th-id strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.th-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.th-menu { position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; z-index: 30; min-width: 200px; }
.th-menu .field { margin-bottom: 10px; }
.th-menu .btn-block { width: 100%; margin-bottom: 8px; }
.messages { display: flex; flex-direction: column; gap: 10px; padding: 12px 8px; overflow-y: auto; flex: 1; background: var(--bg-soft); border-radius: 12px; }
.msg { max-width: 82%; display: flex; flex-direction: column; }
.msg.in { align-self: flex-start; }
.msg.out-ai, .msg.out-human { align-self: flex-end; align-items: flex-end; }
.bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .93rem; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.msg.in .bubble { border-top-left-radius: 5px; }
.msg.out-ai .bubble { background: var(--brand-soft); border-color: var(--brand-line); border-top-right-radius: 5px; }
.msg.out-human .bubble { background: var(--brand); border-color: var(--brand); color: #fff; border-top-right-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,.12); }
.msg small { margin-top: 3px; font-size: .72rem; }
.reply-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); position: relative; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer-input {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 24px;
  padding: 6px 8px; position: relative;
}
.composer-input textarea {
  flex: 1; min-width: 0; border: 0; background: transparent; font: inherit;
  resize: none; outline: none; padding: 8px 4px; max-height: 120px; line-height: 1.4;
}
.cbtn {
  flex-shrink: 0; width: 36px; height: 36px; border: 0; background: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--muted); font-size: 1.2rem;
}
.cbtn:hover { background: rgba(0,0,0,.06); color: var(--text); }
.send-cbtn {
  flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--brand); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.send-cbtn:hover { filter: brightness(1.08); }
.send-cbtn:disabled { opacity: .5; cursor: default; }
.suggest-cbtn { color: var(--brand); }
.voice-rec { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: .3; } }
#voiceTimer { font-weight: 700; font-variant-numeric: tabular-nums; }
.composer-attach { position: relative; }
.attach-menu { position: absolute; bottom: 100%; left: 0; margin-bottom: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 150px; z-index: 20; overflow: hidden; }
.attach-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.attach-menu button:hover { background: var(--bg-soft); }
.emoji-panel { position: absolute; bottom: 100%; right: 0; margin-bottom: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; z-index: 20; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-width: 280px; }
.emoji-panel button { border: 0; background: none; font-size: 1.4rem; padding: 4px; cursor: pointer; border-radius: 6px; }
.emoji-panel button:hover { background: var(--bg-soft); }
.attach-preview { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; flex-basis: 100%; }
.suggest-panel { margin-top: 10px; }
.suggest-card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.suggest-card p { margin: 0 0 8px; font-size: .92rem; }
.suggest-card .actions { display: flex; gap: 8px; }
.reply-form input {
  flex: 1; font: inherit;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px;
}
.reply-form input:focus { outline: 2px solid var(--brand-line); border-color: var(--brand); }

/* ---------- Landing ---------- */
.landing-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
}
.landing-nav-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
}
.landing-links { display: none; gap: 26px; }
.landing-links a { color: var(--ink-soft); font-weight: 500; font-size: .93rem; }
.landing-links a:hover { color: var(--brand-dark); text-decoration: none; }
.landing-cta { display: flex; gap: 10px; align-items: center; }
.mnav { display: block; }
.mnav summary { list-style: none; cursor: pointer; padding: 8px; color: var(--ink-soft); }
.mnav summary::-webkit-details-marker { display: none; }
.mnav .mnav-links {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 8px 20px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.mnav .mnav-links a { padding: 10px 4px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); font-weight: 500; }

.hero {
  max-width: 1120px; margin: 0 auto;
  padding: 64px 20px 40px;
  text-align: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8rem; font-weight: 700;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 18px;
}
.hero h1 { font-size: 2.3rem; margin-bottom: 14px; }
.hero .sub { color: var(--muted); font-size: 1.08rem; max-width: 640px; margin: 0 auto 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.hero-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* pure-CSS product preview */
.mock {
  max-width: 880px; margin: 44px auto 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
}
.mock-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.mock-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-body { display: grid; grid-template-columns: 150px 1fr; min-height: 300px; }
.mock-side { border-right: 1px solid var(--line-soft); padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; }
.mock-link { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); padding: 7px 9px; border-radius: 7px; }
.mock-link.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.mock-main { padding: 16px; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.mock-stat { border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; }
.mock-stat b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.mock-stat span { font-size: .72rem; color: var(--muted); }
.mock-chat { border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-soft); }
.mock-msg { max-width: 75%; padding: 8px 12px; border-radius: 12px; font-size: .8rem; background: var(--bg); border: 1px solid var(--line); }
.mock-msg.in { align-self: flex-start; border-top-left-radius: 3px; }
.mock-msg.out { align-self: flex-end; background: var(--brand-soft); border-color: var(--brand-line); border-top-right-radius: 3px; }

.section { max-width: 1120px; margin: 0 auto; padding: 56px 20px 8px; }
.section h2 { text-align: center; font-size: 1.7rem; margin-bottom: 6px; }
.sec-sub { text-align: center; color: var(--muted); margin-bottom: 30px; }
.feature-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.feature-card { margin: 0; }
.feature-card h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 1rem; }
.feature-card p { color: var(--muted); font-size: .92rem; margin: 0; }

.split { display: grid; gap: 14px; grid-template-columns: 1fr; }
.problem-card { border-top: 3px solid var(--red); }
.solution-card { border-top: 3px solid var(--brand); }
.check-list, .x-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list li, .x-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; }
.check-list .ic { color: var(--brand-dark); margin-top: 3px; }
.x-list .ic { color: var(--red); margin-top: 3px; }

.steps { display: grid; gap: 14px; grid-template-columns: 1fr; }
.step { position: relative; padding-top: 8px; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; margin-bottom: 10px;
}

/* Numbered step groups for settings flows */
.step-group { margin-bottom: 18px; padding-bottom: 4px; }
.step-group + .step-group { border-top: 1px solid var(--line-soft); padding-top: 16px; }
.step-label { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .95rem; margin-bottom: 10px; }
.step-label .step-num { width: 28px; height: 28px; font-size: .85rem; margin-bottom: 0; flex-shrink: 0; }

.pricing-grid { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: stretch; }
.price-card { display: flex; flex-direction: column; margin: 0; }
.price-card.hot { border: 2px solid var(--brand); }
.flag {
  align-self: flex-start;
  font-size: .75rem; font-weight: 700;
  background: var(--brand); color: #fff;
  border-radius: 999px; padding: 3px 12px;
  margin-bottom: 10px;
}
.amount { font-size: 2rem; font-weight: 800; margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.amount small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.price-card ul { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .92rem; }
.price-card ul li { display: flex; gap: 8px; align-items: flex-start; }
.price-card ul .ic { color: var(--brand-dark); margin-top: 3px; }
.price-card .btn { margin-top: auto; }

.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: 15px 18px;
  font-weight: 600; font-size: .95rem;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .ic { color: var(--brand-dark); transition: transform .2s ease; }
.faq-item[open] summary .ic { transform: rotate(180deg); }
.faq-item .faq-body { padding: 0 18px 16px; color: var(--muted); font-size: .92rem; }

.cta-band {
  background: var(--brand-dark);
  color: #fff;
  margin: 64px 0 0;
}
.cta-band-inner { max-width: 1120px; margin: 0 auto; padding: 56px 20px; text-align: center; }
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { color: #cde8e3; margin-bottom: 22px; }
.btn-white { background: #fff; border-color: #fff; color: var(--brand-dark); }
.btn-white:hover { background: var(--brand-soft); border-color: #fff; color: var(--brand-dark); }

.landing-foot { border-top: 1px solid var(--line); background: var(--bg); }
.foot-inner {
  max-width: 1120px; margin: 0 auto; padding: 40px 20px 24px;
  display: grid; gap: 26px; grid-template-columns: 1fr;
}
.foot-brand p { color: var(--muted); font-size: .88rem; max-width: 300px; }
.foot-col h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.foot-col a { display: block; color: var(--ink-soft); font-size: .9rem; padding: 4px 0; }
.foot-bottom {
  max-width: 1120px; margin: 0 auto; padding: 16px 20px 24px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: .82rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
/* footer mobile-app download badges */
.app-badges { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
/* footer mobile-app download badges — .app-badges prefix beats
 * .foot-col a (display:block / padding / color) which broke the <a> badge
 * on mobile: flex lost, padding squashed, icon went dark-on-dark. */
.app-badges .store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: #0f172a; color: #fff; border-radius: 10px;
  padding: 8px 16px 8px 12px; text-decoration: none; max-width: 210px;
}
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge .sb-text { display: flex; flex-direction: column; line-height: 1.3; }
.store-badge .sb-small { font-size: .68rem; color: #cbd5e1; }
.store-badge .sb-big { font-size: .95rem; font-weight: 700; color: #fff; }
a.store-badge:hover { filter: brightness(1.2); }
.store-badge.disabled { background: #475569; cursor: default; }

/* legal pages */
.legal { max-width: 780px; margin: 0 auto; padding: 40px 20px 80px; }
.legal h1 { margin-bottom: 6px; }
.legal h2 { font-size: 1.05rem; margin-top: 1.8em; }
.legal p, .legal li { color: var(--ink-soft); font-size: .94rem; }
.legal ul { padding-left: 20px; }

/* ---------- Hints, misc ---------- */
.hint { background: var(--bg); }
.hint ol { margin: 8px 0; padding-left: 20px; color: var(--ink-soft); font-size: .92rem; }
.hint li { margin-bottom: 8px; }
.quota-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.quota-head h3 { margin: 0; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
@media (max-width: 899px) {
  .toolbar { gap: 8px; margin-bottom: 12px; }
  .toolbar .field { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .toolbar .field input, .toolbar .field select { width: 100%; font-size: .85rem; padding: 9px 12px; }
  .toolbar .btn { flex: 1 1 calc(50% - 4px); justify-content: center; }
}
@media (max-width: 899px) {
  .empty { padding: 28px 16px; }
}

/* ---------- Admin (legacy) ----------
   Stage 7.9: the dead legacy .admin-* block was deleted — zero views
   used those classes (verified by grep). Only .admin-tag survives: it
   is live on login/setup (its teal admin.css twin under body.ax-auth
   wins while style.css still loads). .mono stays: tenant views use it. */
.admin-tag {
  display: inline-block; margin: 0 8px 12px;
  font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--brand-ink); background: var(--brand-soft);
  border: 1px solid var(--brand-line); border-radius: 999px; padding: 2px 10px;
}
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82em; }

/* ---------- Responsive ---------- */
.desktop-only { display: none; }
.mobile-only { display: inline; }
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards.two { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .topbar { display: none; }
  .bottomnav { display: none; }
  .sidebar { display: flex; flex-direction: column; }
  .page { margin-left: var(--sidebar-w); padding: 28px 32px 60px; }
  .desktop-only { display: block; }
  h1.desktop-only { display: block; }
  .mobile-only { display: none !important; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards.two, .split { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .landing-links { display: flex; }
  .mnav { display: none; }
  .foot-inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .inbox-grid { grid-template-columns: 320px minmax(0, 1fr); align-items: stretch; }
  /* Desktop inbox: app-like fixed layout, no page scroll */
  .page.inbox-page { height: calc(100dvh - 60px); display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
  .page.inbox-page .inbox-top { flex-shrink: 0; }
  .page.inbox-page .inbox-grid { flex: 1; min-height: 0; }
  .conv-list { max-height: none; height: 100%; overflow-y: auto; position: static; }
  .thread { display: flex; flex-direction: column; max-height: none; height: 100%; min-height: 0; }
  .thread .messages { flex: 1; min-height: 0; overflow-y: auto; }
  .thread .reply-form { flex-shrink: 0; }
  /* Desktop filter bar: side-by-side */
  .filter-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .filter-row .ftabs, .filter-row .fpills { flex-wrap: wrap; }
  body.thread-open .conv-list { display: block; }
  .hero h1 { font-size: 2.9rem; }
}
@media (max-width: 899px) {
  .topbar { display: flex; }
  .page { padding-top: 16px; }
  /* P2: Mobile inbox — prevent whole-page scroll, constrain thread to viewport */
  body.thread-open { overflow: hidden; }
  body.thread-open .page.inbox-page { padding-bottom: 0; overflow-x: hidden; }
  body.thread-open .inbox-top { display: none; }
  body.thread-open .customer-mobile { display: none; }
  body.thread-open .thread {
    height: calc(100dvh - 130px);
    min-height: 0;
    max-height: none;
    width: 100%; max-width: 100%; overflow-x: hidden;
  }
  body.thread-open .messages { min-height: 0; overflow-x: hidden; }
  body.thread-open .msg { max-width: 85%; }
  body.thread-open .reply-form { max-width: 100%; overflow: hidden; }
  body.thread-open .composer-row { max-width: 100%; }
}

/* ---------- Workstream A: products + contacts utilities (additive) ---------- */
.btn-soft { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.btn-soft:hover { background: var(--bg-soft); border-color: var(--line); color: var(--ink); text-decoration: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cell-main { display: flex; gap: 10px; align-items: center; }
.cell-main .icon-wrap { flex: none; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); flex: none; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 18px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 94vw); background: var(--bg); z-index: 61; overflow-y: auto; border-left: 1px solid var(--line); box-shadow: var(--shadow); padding: 20px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.msg-row { padding: 10px 12px; border-radius: 12px; margin-bottom: 8px; background: var(--bg-soft); border: 1px solid var(--line-soft); }
.msg-row.out { background: var(--brand-soft); border-color: var(--brand-line); }
/* Orders + WooCommerce responsive */
@media (max-width: 640px) {
  .page-head h2 { font-size: 1.15rem; }
  /* Orders table: hide the date column on phones, keep it readable */
  .orders-table th:nth-child(6), .orders-table td:nth-child(6) { display: none; }
  .orders-table th, .orders-table td { padding: 8px 10px; font-size: .87rem; }
  .filters { gap: 6px; margin-bottom: 12px; }
  .chip { padding: 6px 12px; font-size: .82rem; }
}
/* Drawer (side panel) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 20, .5); z-index: 1050; animation: toastIn .18s ease-out; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--bg); z-index: 1051; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: drawerIn .22s ease-out; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer-head h3 { margin: 0; font-size: 1.05rem; flex: 1; }
.drawer-close { background: none; border: none; cursor: pointer; padding: 8px; border-radius: var(--r-sm); color: var(--muted); }
.drawer-close:hover { background: var(--bg-soft); color: var(--ink); }
.drawer-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: .5; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 88vh; border-radius: var(--r) var(--r) 0 0; animation: sheetIn .22s ease-out; }
}
@keyframes sheetIn { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop { animation: none; } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 20, .5); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: toastIn .18s ease-out; }
.modal { background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow); width: 100%; max-width: 440px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { padding: 18px 20px 0; }
.modal-head h3 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.modal-head h3 .ic { color: var(--amber); flex-shrink: 0; }
.modal-danger h3 .ic { color: var(--red); }
.modal-body { padding: 12px 20px 4px; color: var(--ink-soft); font-size: .94rem; line-height: 1.55; }
.modal-foot { padding: 16px 20px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-foot .btn { min-width: 96px; }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: var(--r) var(--r) 0 0; max-height: 92vh; }
}
@media (prefers-reduced-motion: reduce) { .modal-backdrop { animation: none; } }
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow); font-size: .9rem; animation: toastIn .25s ease-out; }
.toast .ic { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.toast-success { background: #0d7a6e; }
.toast-error { background: #b91c1c; }
.toast-warning { background: #b45309; }
.toast-info { background: #1d4ed8; }
.toast.out { animation: toastOut .2s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
@media (max-width: 640px) { .toast-wrap { bottom: 16px; right: 16px; left: 16px; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
.pill.st-draft { background: var(--bg-soft); color: var(--muted); }
.pill.st-pending_confirm { background: var(--amber-soft); border-color: #f0dcae; color: var(--amber); }
.pill.st-confirmed { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.pill.st-cancelled { background: var(--red-soft); border-color: #f3c2c2; color: var(--red); }
.field-err { color: var(--red); font-size: .85rem; margin: 4px 0 0; }
.err-list { margin: 0; padding-left: 20px; }
.err-list li { margin-bottom: 6px; color: var(--red); font-size: .9rem; }
pre.code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font-size: .85rem; overflow-x: auto; }
.preview-box { background: #f0f7f4; border: 1px solid var(--line); border-radius: 10px; padding: 14px; white-space: pre-wrap; }
.var-tag { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); border-radius: 6px; padding: 1px 7px; font-weight: 600; font-size: .8rem; }

/* ---------- Responsive hardening (2026-10-15) ---------- */
code { overflow-wrap: break-word; }
.secret-box { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin: 10px 0; }
.secret-box code { overflow-wrap: anywhere; word-break: break-all; font-size: .85rem; }
.reply-form input { min-width: 0; }
.reply-form .btn { min-height: 44px; }
.ftab, .fpill { min-height: 40px; display: inline-flex; align-items: center; }
/* Order status filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); font-size: .87rem; font-weight: 600; background: var(--bg); text-decoration: none; }
.chip:hover { border-color: var(--brand); color: var(--brand-dark); text-decoration: none; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 640px) {
  .mock-body { grid-template-columns: 1fr; }
  .mock-side { display: none; }
}

/* Sticky action column for user tables on small screens */
@media (max-width: 640px) {
  .table-wrap .table th:last-child, .table-wrap .table td:last-child {
    position: sticky; right: 0;
    background: var(--bg);
    box-shadow: -8px 0 12px -8px rgba(15,23,42,.18);
  }
  .table-wrap .table thead th:last-child { background: var(--bg-soft); }
}
.pf-head-text { flex: 1 1 auto; min-width: 200px; }

.pf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; max-width: 1280px; align-items: start; }
.pf-main { display: grid; gap: 20px; min-width: 0; }
.pf-side { display: grid; gap: 20px; align-content: start; position: sticky; top: 16px; min-width: 0; }

.pf-sec { margin-bottom: 0; }
.pf-sec-head { margin-bottom: 14px; }
.pf-sec-head h2 { margin: 0 0 4px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.pf-sec-head h2 .ic { color: var(--brand-dark); }
.pf-sec-head p { margin: 0; color: var(--muted); font-size: .88rem; }
.pf-sec-head h3 { margin: 0; font-size: .95rem; }

.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.pf-grid .field { margin-bottom: 0; }
.pf-span { grid-column: 1 / -1; }
.pf-opt { font-weight: 400; color: var(--muted); font-size: .85rem; }
.pf-note { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }

/* Currency input */
.pf-curwrap { position: relative; display: block; margin-top: 6px; }
.pf-curwrap input { padding-left: 30px !important; }
.pf-cur { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }

/* Image dropzone */
.pf-drop { border: 2px dashed var(--line); border-radius: var(--r); background: var(--bg-soft); padding: 26px 18px; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.pf-drop:hover, .pf-drop:focus-visible, .pf-drop.over { border-color: var(--brand); background: var(--brand-soft); outline: none; }
.pf-drop .icon-wrap { margin: 0 auto 8px; }
.pf-drop-title { font-weight: 700; margin: 0 0 4px; }
.pf-drop-idle p { margin: 0 0 4px; }
.pf-drop-prev { position: relative; display: inline-block; }
.pf-drop-prev img { width: 132px; height: 132px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; }
.pf-drop-rm { position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--red); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.pf-drop-rm:hover { background: var(--red-soft); }
.pf-progress { height: 6px; background: var(--line-soft); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.pf-progress i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .2s ease; }

/* Category attributes */
.pf-attr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.pf-attr-grid .field { margin-bottom: 0; }
.pf-attr-empty { display: flex; gap: 10px; align-items: flex-start; background: var(--bg-soft); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 14px; color: var(--muted); font-size: .9rem; }
.pf-attr-empty .ic { color: var(--brand-dark); flex-shrink: 0; margin-top: 2px; }
.pf-attr-empty p { margin: 0; }

/* Variant builder (create mode) */
.pf-varhead { margin: 4px 0 10px; }
.pf-varhead h3 { margin: 0 0 2px; font-size: .95rem; }
.pf-varhead p { margin: 0; }
.pf-var-row { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 8px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 10px; }
.pf-var-row .field { margin-bottom: 0; font-size: .82rem; }
.pf-var-row .field input { padding: 8px 10px; }
.pf-var-rm { width: 34px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--red); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pf-var-rm:hover { background: var(--red-soft); }

/* Publish sidebar */
.pf-actions { display: grid; gap: 8px; }
.pf-sum { margin: 0; display: grid; gap: 8px; }
.pf-sum > div { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.pf-sum dt { color: var(--muted); }
.pf-sum dd { margin: 0; font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; }

/* Mobile sticky action bar */
.pf-mobilebar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--bg); border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 10px; box-shadow: 0 -4px 16px rgba(15, 23, 42, .08); }
.pf-mobilebar .btn { flex: 1; }

/* Edit-mode extra cards */
.pf-edit-extra { display: grid; gap: 20px; margin-top: 20px; max-width: 1280px; }
.pf-galgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 4px; }
.pf-galitem { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; text-align: center; background: var(--bg); }
.pf-galitem.is-primary { border-color: var(--brand-line); box-shadow: 0 0 0 1px var(--brand-line); }
.pf-galitem img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; display: block; }
.pf-galitem-actions { margin-top: 6px; display: flex; gap: 4px; justify-content: center; align-items: center; flex-wrap: wrap; }
.pf-stockform { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: end; }
.pf-stockform .field { margin-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .pf-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1023px) {
  .pf-layout { grid-template-columns: 1fr; max-width: 860px; }
  .pf-side { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .pf-mobilebar { display: flex; }
  .pf-layout { padding-bottom: 8px; }
  main.page:has(.pf-mobilebar) { padding-bottom: 132px; }
}
@media (max-width: 640px) {
  .pf-grid, .pf-attr-grid { grid-template-columns: 1fr; }
  .pf-side { grid-template-columns: 1fr; }
  .pf-var-row { grid-template-columns: 1fr 1fr; }
  .pf-var-row .pf-var-rm { grid-column: 1 / -1; width: 100%; height: 36px; }
  .pf-stockform { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .pf-drop { padding: 20px 12px; }
  .pf-sec-head h2 { font-size: 1rem; }
}

/* ============================================================
   Premium dashboard (dashboard.ejs)
   ============================================================ */
.dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #075e54 0%, #0b7a6c 55%, #12a08d 100%);
  color: #fff;
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 28px rgba(7, 94, 84, .30);
}
.dash-hero::before, .dash-hero::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .09);
  pointer-events: none;
}
.dash-hero::before { width: 230px; height: 230px; right: -75px; top: -75px; }
.dash-hero::after { width: 150px; height: 150px; right: 55px; bottom: -85px; background: rgba(255, 255, 255, .06); }
.dash-hero .hero-inner { position: relative; z-index: 1; }
.dash-hero h1 { color: #fff; font-size: 1.4rem; margin: 0 0 4px; letter-spacing: -0.01em; }
.hero-date {
  margin: 0 0 16px; color: rgba(255, 255, 255, .88);
  font-size: .88rem; display: flex; align-items: center; gap: 7px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-hero {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 12px; padding: 10px 18px;
  font: inherit; font-weight: 700; font-size: .92rem;
  text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn-hero:hover { text-decoration: none; transform: translateY(-1px); }
.btn-hero.solid { background: #fff; color: #075e54; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.btn-hero.solid:hover { background: #f2faf8; }
.btn-hero.ghost { border: 1.5px solid rgba(255, 255, 255, .55); color: #fff; }
.btn-hero.ghost:hover { background: rgba(255, 255, 255, .12); }
.hero-chips { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .25);
  color: #fff; border-radius: 999px; padding: 5px 13px; font-size: .8rem; font-weight: 600;
}

/* Tinted gradient icon tiles */
.tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 15px; flex-shrink: 0;
}
.tile .ic { width: 24px; height: 24px; }
.tile.sm { width: 36px; height: 36px; border-radius: 11px; }
.tile.sm .ic { width: 19px; height: 19px; }
.t-teal   { background: linear-gradient(135deg, #d3efe9, #eafaf6); color: #0b7a6c; }
.t-blue   { background: linear-gradient(135deg, #d7e6fd, #eef4ff); color: #1d4ed8; }
.t-violet { background: linear-gradient(135deg, #e6e1fd, #f4f2ff); color: #6d28d9; }
.t-amber  { background: linear-gradient(135deg, #fdeecb, #fffaf0); color: #b45309; }
.t-green  { background: linear-gradient(135deg, #d3f5dd, #effdf3); color: #15803d; }
.t-rose   { background: linear-gradient(135deg, #ffdee2, #fff1f3); color: #be123c; }

/* Premium stat cards */
.dash-stats .stat-prem {
  display: flex; gap: 13px; align-items: center;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px;
  box-shadow: var(--shadow-sm); margin-bottom: 0;
  transition: transform .14s ease, box-shadow .14s ease;
}
@media (hover: hover) {
  .dash-stats .stat-prem:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
}
.stat-prem .num {
  font-size: 1.65rem; font-weight: 800; line-height: 1.15;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.stat-prem .lbl { color: var(--muted); font-size: .83rem; margin-top: 2px; }

/* Quota card */
.quota-card .bar { height: 12px; }
.quota-fill { background: linear-gradient(90deg, #0b7a6c, #2bd98a); }
.quota-fill.warn { background: linear-gradient(90deg, #d97706, #fbbf24); }
.quota-fill.danger { background: linear-gradient(90deg, #dc2626, #f87171); }
.quota-head .spacer { flex: 1; }
.quota-pct {
  font-weight: 800; font-size: .9rem; color: var(--brand-ink);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: 999px; padding: 3px 12px; font-variant-numeric: tabular-nums;
}
.quota-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 0; flex-wrap: wrap; }

/* Volume chart */
.dash-bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 12px; }
.dash-bars .dcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.dash-bars .dval { font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dash-bars .dlab { font-size: .72rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 480px) {
  .dash-bars { gap: 5px; }
  .dash-bars .dcol:nth-child(even) .dlab { display: none; }
}

/* Channel split */
.splitbar { height: 20px; border-radius: 999px; overflow: hidden; display: flex; background: var(--bg-softer); box-shadow: inset 0 1px 3px rgba(0,0,0,.08); }
.splitbar .wa { background: linear-gradient(90deg, #1eb85a, #25d366); }
.splitbar .ms { background: linear-gradient(90deg, #0073e6, #33a1ff); }
.split-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.split-legend .leg { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; color: var(--ink-soft); }
.split-legend .leg b { font-variant-numeric: tabular-nums; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.wa { background: #25d366; }
.dot.ms { background: #0084ff; }
.dist-pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* Section titles */
.sec-title { display: flex; align-items: center; gap: 10px; }
.sec-title .link-more { margin-left: auto; font-size: .82rem; font-weight: 700; }

/* Recent conversations */
.recent-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 14px; color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
@media (hover: hover) {
  .recent-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--brand-line); }
}
.recent-item:hover { text-decoration: none; }
.recent-body { flex: 1; min-width: 0; }
.recent-top { display: flex; align-items: center; gap: 8px; }
.recent-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-preview { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.chan-badge {
  font-size: .68rem; font-weight: 800; letter-spacing: .03em;
  border-radius: 6px; padding: 2px 7px; flex-shrink: 0;
}
.chan-badge.wa { background: #dcf5e4; color: #12805c; }
.chan-badge.ms { background: #dbeafe; color: #1d4ed8; }
.recent-chev { color: var(--muted); flex-shrink: 0; }
.avatar.grad {
  background: linear-gradient(135deg, #0b7a6c, #25b892);
  color: #fff; font-weight: 800; border: none;
}
@media (max-width: 480px) {
  .dash-hero { padding: 20px 16px; border-radius: 16px; }
  .dash-hero h1 { font-size: 1.22rem; }
  .dash-stats .stat-prem { padding: 13px 12px; gap: 10px; border-radius: 14px; }
  .dash-stats .tile { width: 42px; height: 42px; border-radius: 13px; }
  .dash-stats .tile .ic { width: 22px; height: 22px; }
  .stat-prem .num { font-size: 1.38rem; }
  .stat-prem .lbl { font-size: .78rem; }
}

/* ==========================================================================
   Group A: shared app shell + design system (2026-10-16)
   Responsive helpers, app list, bottom sheet, skeleton, sticky action bar,
   segmented control, stat grid, back link, narrow container, sidebar
   collapse (desktop icon rail), safe-area-aware bottomnav & topbar.
   ========================================================================== */

/* --- visibility helpers (900px app breakpoint) --- */
.only-desktop { display: none; }
@media (min-width: 900px) {
  .only-mobile { display: none !important; }
  .only-desktop { display: revert; }
}

/* --- app list: icon tile + body (title + meta) + chevron --- */
.app-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.app-list-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); font-family: inherit; font-size: .93rem; text-align: left;
  width: 100%; max-width: 100%;
}
a.app-list-item:hover { text-decoration: none; border-color: var(--brand-line); background: var(--brand-soft); }
button.app-list-item { cursor: pointer; }
.app-list-item .app-list-body { flex: 1; min-width: 0; }
.app-list-item .app-list-title {
  display: block; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-list-item .app-list-meta {
  display: block; font-size: .8rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-list-chev { color: var(--muted); flex-shrink: 0; width: 18px; height: 18px; }

/* --- sheet-mode product form (mobile bottom sheet) --- */
.drawer-body .pf-sheet { margin: 0; }
.drawer-body .pf-sheet .page-head.compact { margin-bottom: 10px; }
.drawer-body main.page { padding: 0; margin: 0; max-width: none; }
/* --- mobile product cards: dedicated thumb-friendly design (products page) --- */
.pcard-list { display: flex; flex-direction: column; gap: 10px; }
.pcard {
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 12px 10px; box-shadow: 0 1px 2px rgba(16, 24, 20, .04);
}
.pcard-main { display: flex; align-items: center; gap: 10px; }
.pcard-check { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--brand); }
.pcard-thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--bg-softer); }
.pcard-ic { flex-shrink: 0; }
.pcard-info { flex: 1; min-width: 0; }
.pcard-name { display: block; font-size: .95rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.pcard-price { font-weight: 800; font-size: 1.05rem; color: var(--brand-ink); white-space: nowrap; flex-shrink: 0; }
.pcard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pcard-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pcard-actions .btn { justify-content: center; width: 100%; }
.pcard-actions form.inline { display: contents; }
/* bulk bar + pager breathe on small screens */
@media (max-width: 899px) {
  .bulk-bar { flex-wrap: wrap; gap: 8px; }
  .bulk-bar select { flex: 1 1 auto; min-width: 0; }
  .pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
}
@keyframes skel-shimmer { 100% { transform: translateX(100%); } }

/* --- sticky bottom action bar (forms on mobile) --- */
.sticky-actions {
  position: sticky; bottom: 0; z-index: 20;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 18px;
}
.sticky-actions .btn { flex: 1; min-height: 44px; }

/* --- segmented tab control --- */
.seg {
  display: flex; gap: 4px;
  background: var(--bg-softer); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px;
}
.seg a, .seg button {
  flex: 1; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 10px; border: 0; border-radius: 999px;
  background: none; color: var(--muted);
  font-family: inherit; font-weight: 600; font-size: .88rem;
  cursor: pointer; white-space: nowrap;
}
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.on, .seg button.on {
  background: var(--bg); color: var(--brand-ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}

/* --- responsive stat grid --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }

/* --- back link (detail / form pages) --- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 4px;
  color: var(--muted); font-weight: 600; font-size: .9rem;
}
.back-link:hover { text-decoration: none; color: var(--brand-dark); }

/* --- narrow content container (forms / settings) --- */
.page-narrow { max-width: 880px; margin: 0 auto; }

/* --- desktop sidebar collapse → icon rail --- */
.sidebar-head { display: flex; align-items: center; gap: 6px; margin: 2px 8px 14px; }
.sidebar-head .brand { margin: 0; flex: 1; min-width: 0; }
.sidebar-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0;
  border: 0; border-radius: var(--r-sm);
  background: none; color: var(--muted); cursor: pointer;
}
.sidebar-toggle:hover { background: var(--bg-soft); color: var(--ink); }
@media (min-width: 900px) {
  .sidebar-toggle { display: inline-flex; }
  body.sidebar-collapsed .sidebar { width: 68px; padding-left: 8px; padding-right: 8px; }
  body.sidebar-collapsed .page { margin-left: 68px; }
  body.sidebar-collapsed .sidebar-head { margin: 2px 0 14px; justify-content: center; }
  body.sidebar-collapsed .sidebar-head .brand { display: none; }
  body.sidebar-collapsed .nav-label { display: none; }
  body.sidebar-collapsed .sidebar a.navlink {
    font-size: 0; gap: 0; justify-content: center; padding: 11px 0;
  }
  body.sidebar-collapsed .sidebar a.navlink .ic { width: 20px; height: 20px; }
  body.sidebar-collapsed .nav-profile { justify-content: center; padding: 12px 0 4px; }
  body.sidebar-collapsed .nav-profile-meta { display: none; }
  body.sidebar-collapsed .nav-logout { padding: 0; }
  body.sidebar-collapsed .nav-logout button {
    font-size: 0; gap: 0; justify-content: center; padding: 11px 0;
  }
}

/* --- bottomnav: safe-area, 44px+ targets, clear active state (OLD - replaced by bubble) --- */
/* .bottomnav { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
.bottomnav a { min-height: 48px; min-width: 44px; justify-content: center; }
.bottomnav a.on { background: var(--brand-soft); } */

/* --- topbar: notch safe-area, stays sticky (no content overlap) --- */
.topbar { padding-top: calc(10px + env(safe-area-inset-top)); }

/* ---------- I5: conversation memory status strip (inbox thread header) ----------
   Compact, collapsible, fits the existing design system (reuses .pill, .muted).
   No horizontal overflow on small screens: header wraps, rows flex-shrink. */
.mem-strip {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--bg-soft);
  margin: 0 0 8px;
  max-width: 100%;
}
.mem-strip > summary.mem-strip-head {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  font-size: .82rem;
  min-width: 0;
  color: var(--text);
}
.mem-strip > summary.mem-strip-head::-webkit-details-marker { display: none; }
.mem-strip-head strong { font-size: .82rem; }
.mem-strip-head .chev {
  margin-left: auto;
  color: var(--muted);
  display: inline-flex;
  flex-shrink: 0;
  transition: transform .15s ease;
}
.mem-strip[open] > summary.mem-strip-head .chev { transform: rotate(180deg); }
.mem-strip-body { padding: 2px 12px 8px; min-width: 0; }
.mem-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
  font-size: .82rem;
  min-width: 0;
}
.mem-kv > span:first-child { color: var(--muted); flex-shrink: 0; }
.mem-kv > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

/* ==========================================================================
   DASHBOARD — Master Responsive Polish (2026-10-17)
   Mobile-first app feel · Desktop premium SaaS · Frontend-only
   ========================================================================== */

/* --- Dashboard page container: constrain width on very wide screens --- */
.page-dashboard { }

/* --- Hero: tighter on mobile, airier on desktop --- */
@media (max-width: 899px) {
  .dash-hero { padding: 18px 16px; border-radius: 16px; margin-bottom: 14px; }
  .dash-hero h1 { font-size: 1.15rem; }
  .hero-date { font-size: .82rem; margin-bottom: 12px; }
  .hero-actions { gap: 8px; }
  .btn-hero { padding: 10px 14px; font-size: .88rem; min-height: 44px; }
  .hero-chips { margin-top: 12px; gap: 6px; }
  .hero-chip { font-size: .75rem; padding: 5px 11px; }
}
@media (min-width: 900px) {
  .dash-hero { padding: 28px 28px; }
  .dash-hero h1 { font-size: 1.6rem; }
}

/* --- Stat grid: 2 cols on phones, 3 on tablet, 6 on desktop --- */
.dash-stats.stat-grid { gap: 10px; }
/* --- Dashboard stat grids: vertical separation + blowout guard ---
 * Two .stat-grid.dash-stats blocks sit directly on top of each other
 * (আজকের আপডেট + the inbox/AI/orders grid) with no margin anywhere:
 * .stat-grid has no margin-bottom and .stat-prem sets margin-bottom: 0,
 * so the two grids touched and read as one merged, misaligned block
 * (the 4-card grid is wider per card than the 6-card grid, so their
 * edges never line up). margin-bottom on the grid gives every grid its
 * own breathing room at all sizes; it collapses with the quota card's
 * margin-top (14px), so that junction stays 14px.
 * min-width: 0 + overflow: hidden on the cards is the same blowout
 * guard the repo already uses for .fg-stat/.db-stats: a card's
 * min-content (tile + longest number/label word, measured in Hind
 * Siliguri) fits today's tracks with ~10px to spare, but a bigger
 * future value (e.g. revenue ৳12,34,567) would exceed the 200px
 * auto-fit floor and push the last card off the right edge. With the
 * guard the card shrinks to its track instead of blowing out the grid. */
.page-dashboard .stat-grid.dash-stats { margin-bottom: 12px; }
.dash-stats .stat-prem { min-width: 0; overflow: hidden; }
@media (max-width: 430px) {
  .dash-stats.stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dash-stats .stat-prem { padding: 12px; gap: 10px; border-radius: 14px; }
  .dash-stats .stat-prem .tile { width: 40px; height: 40px; border-radius: 12px; }
  .dash-stats .stat-prem .tile .ic { width: 20px; height: 20px; }
  .stat-prem .num { font-size: 1.35rem; }
  .stat-prem .lbl { font-size: .78rem; }
}
/* 431-599px phones (e.g. iPhone 16 Pro Max, 440px) got the 3-col tablet
 * rule, but the Woo summary cards need ~150-160px (long Bengali words +
 * sales line) vs ~130px per track, so the grid overflowed right and the
 * 3rd card was cut off. 2 cols below 600px; 3 cols resume where they fit. */
@media (min-width: 431px) and (max-width: 599px) {
  .dash-stats.stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 600px) and (max-width: 899px) {
  .dash-stats.stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .dash-stats.stat-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 1280px) {
  .dash-stats.stat-grid { gap: 14px; }
}

/* --- Quota card: better spacing --- */
.quota-card { margin-top: 14px; }
@media (max-width: 899px) {
  .quota-card { margin-top: 12px; }
}

/* --- Volume chart: readable bars on all sizes --- */
@media (max-width: 430px) {
  .dash-bars { height: 140px; gap: 4px; }
  .dash-bars .dval { font-size: .72rem; }
  .dash-bars .dlab { font-size: .66rem; }
}
@media (min-width: 900px) {
  .dash-bars { height: 180px; gap: 14px; }
}

/* --- Two-column cards: stack on mobile --- */
@media (max-width: 899px) {
  .cards.two { grid-template-columns: 1fr; }
}

/* --- Section title: consistent spacing --- */
.sec-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.05rem; font-weight: 800; margin: 20px 0 12px;
}
.sec-title .link-more { margin-left: auto; font-size: .85rem; font-weight: 600; }
@media (max-width: 899px) {
  .sec-title { font-size: .98rem; margin: 16px 0 10px; }
}

/* --- Recent list: touch-friendly --- */
.recent-list .app-list-item { min-height: 60px; }
@media (max-width: 899px) {
  .recent-list { gap: 8px; }
}

/* --- Empty state: centered, breathing room --- */
.page-dashboard .card.empty { text-align: center; padding: 32px 20px; }
@media (max-width: 899px) {
  .page-dashboard .card.empty { padding: 24px 16px; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .dash-stats .stat-prem,
  .btn-hero { transition: none; }
  .dash-stats .stat-prem:hover,
  .btn-hero:hover { transform: none; }
}

/* --- Volume chart v2: stacked incoming/outgoing bars --- */
.vol-legend { display: flex; gap: 16px; margin: 4px 0 8px; font-size: .82rem; color: var(--muted); }
.vol-legend .leg { display: inline-flex; align-items: center; gap: 6px; }
.vol-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.vol-legend b { font-variant-numeric: tabular-nums; }
.vol-bars .dbar-stack {
  width: 100%; max-width: 46px; min-height: 5px;
  border-radius: 8px; overflow: hidden;
  display: flex; flex-direction: column-reverse;
  background: var(--bg-softer);
  box-shadow: 0 3px 8px rgba(18, 140, 126, .12);
}
.vol-bars .dbar-seg { width: 100%; min-height: 0; }
.vol-bars .seg-in { background: linear-gradient(180deg, #2bd98a 0%, #0e8a76 100%); }
.vol-bars .seg-out { background: linear-gradient(180deg, #a5c0fa 0%, #7c9ff5 100%); }
@media (max-width: 430px) {
  .vol-bars .dbar-stack { max-width: 34px; }
  .vol-legend { font-size: .76rem; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .vol-bars .dbar-stack { box-shadow: none; }
}

/* --- Recent conversations: scrollable list --- */
.recent-scroll {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.recent-scroll::-webkit-scrollbar { width: 6px; }
.recent-scroll::-webkit-scrollbar-track { background: transparent; }
.recent-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.recent-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }
@media (max-width: 899px) {
  .recent-scroll { max-height: 280px; }
}
@media (min-width: 900px) {
  .recent-scroll { max-height: 360px; }
}

/* ==========================================================================
   CONTACTS — Master Responsive Polish (2026-10-17)
   Mobile-first app feel · Desktop premium SaaS · Frontend-only
   ========================================================================== */

/* --- Filter toolbar: stack nicely on mobile --- */
@media (max-width: 640px) {
  .toolbar { gap: 8px; margin-bottom: 12px; }
  .toolbar .field { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .toolbar .field input, .toolbar .field select { width: 100%; }
  .toolbar .btn { flex: 1 1 calc(50% - 4px); justify-content: center; min-height: 44px; }
}

/* --- Mobile contact cards: breathing room --- */
@media (max-width: 899px) {
  .only-mobile.app-list { gap: 8px; }
  .only-mobile .app-list-item { padding: 12px; min-height: 64px; }
  .only-mobile .app-list-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .only-mobile .app-list-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
  .only-mobile .app-list-tags .pill { font-size: .72rem; padding: 2px 8px; }
}

/* --- Contact detail drawer: proper scroll body --- */
.drawer .card { margin-bottom: 12px; }
@media (max-width: 640px) {
  .drawer { padding: 0; }
  .drawer-head { padding: 14px 16px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
  .drawer > .card { margin: 12px 16px; }
  .drawer > .card:first-of-type { margin-top: 12px; }
  .drawer > .card:last-child { margin-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (min-width: 641px) {
  .drawer { padding: 20px; }
}

/* --- Message rows in drawer: chat-like --- */
.msg-row { line-height: 1.5; }
.msg-row p:first-child { overflow-wrap: break-word; }

/* --- Desktop table: sticky header, better density --- */
@media (min-width: 900px) {
  .table-wrap .table thead th {
    position: sticky; top: 0; background: var(--bg);
    font-size: .82rem; text-transform: uppercase; letter-spacing: .04em;
  }
  .table-wrap .table td { padding: 12px 14px; }
  .table-wrap .table tbody tr:hover { background: var(--bg-softer); }
}

/* --- Desktop orders: fix layout issues (2026-10-31) --- */
@media (min-width: 900px) {
  /* 1. Filter button redundant on desktop (filters visible inline) */
  #filterBtn { display: none; }
  /* 2. No sticky filter card on desktop (shrinks table viewport) */
  .order-sticky-head { position: static; }
  /* 3. No internal scroll on desktop (single natural page scroll) */
  .order-scroll { max-height: none; min-height: 0; overflow: visible; }
  .order-scroll thead th { position: static; }
}

/* --- Pager: centered, touch-friendly --- */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0 8px; }
.pager .btn { min-height: 40px; }
@media (max-width: 640px) {
  .pager { gap: 8px; }
}

/* --- Empty state --- */
.page .card.empty { text-align: center; padding: 40px 24px; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .only-mobile .app-list-item { transition: none; }
}

/* --- Contacts audit fixes (2026-10-17) --- */
/* Filter panel: remove bottom-heavy spacing when toolbar is last in card */
.card > .toolbar:last-child { margin-bottom: 0; }

/* Empty status cell: consistent muted dash */
.table td .pill:empty { display: none; }

/* --- Mobile contact cards: refined layout --- */
@media (max-width: 899px) {
  .only-mobile.app-list .app-list-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 12px 12px;
  }
  .only-mobile .app-list-main { min-width: 0; }
  .only-mobile .app-list-main strong {
    display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .95rem;
  }
  .only-mobile .app-list-main .muted.small {
    display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .only-mobile .avatar { width: 44px; height: 44px; font-size: 1.1rem; }
}

/* ==========================================================================
   CONTACTS — Filter popup redesign (2026-10-17)
   Compact toolbar + modal filter · Frontend-only
   ========================================================================== */

/* --- Compact toolbar --- */
.contacts-toolbar {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 14px;
}
.ct-search {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; min-height: 44px;
}
.ct-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ct-search-icon { color: var(--muted); flex-shrink: 0; display: inline-flex; }
.ct-search input {
  flex: 1; min-width: 0; border: 0; background: none;
  font: inherit; font-size: .92rem; padding: 10px 0; color: var(--ink);
}
.ct-search input:focus { outline: none; }
.ct-filter-btn { position: relative; flex-shrink: 0; min-height: 44px; white-space: nowrap; }
.ct-filter-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: .7rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.ct-csv-btn { flex-shrink: 0; min-height: 44px; }
@media (max-width: 480px) {
  .ct-csv-label { display: none; }
  .ct-csv-btn { padding-left: 12px; padding-right: 12px; }
}

/* --- Filter modal --- */
.ct-filter-modal .modal { max-width: 400px; }
.ct-filter-modal .modal-body { padding: 4px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.ct-filter-modal .modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 20px; border-top: 1px solid var(--line-soft); margin: 16px -20px 0;
}
.ct-filter-modal .modal-foot .btn { min-height: 44px; }
@media (max-width: 640px) {
  .ct-filter-modal { align-items: flex-end; padding: 0; }
  .ct-filter-modal .modal {
    max-width: none; width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 85vh; max-height: 85dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ct-filter-modal .modal-foot { flex-direction: column-reverse; }
  .ct-filter-modal .modal-foot .btn { width: 100%; justify-content: center; }
}

/* --- Hide old toolbar card styles for contacts --- */
@media (prefers-reduced-motion: reduce) {
  .ct-search { transition: none; }
}

/* --- Fix: hidden attribute must override display:flex (without !important breaking JS toggle) --- */
.modal-backdrop[hidden] { display: none; }

/* ============ Products redesign: compact toolbar + filter popup ============ */
.page-products { }

/* Compact toolbar */
.pd-toolbar {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 14px; flex-wrap: wrap;
}
.pd-search {
  position: relative; flex: 1 1 220px; min-width: 0; display: flex;
}
.pd-search-ic {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted, #64748b); display: flex; pointer-events: none;
}
.pd-search input {
  width: 100%; padding: 10px 12px 10px 36px;
  border: 1px solid var(--border, #e2e8f0); border-radius: 10px;
  font-size: .92rem; background: #fff;
}
.pd-search input:focus { outline: 2px solid var(--brand, #10b981); outline-offset: -1px; border-color: var(--brand, #10b981); }
.pd-filter-btn { position: relative; white-space: nowrap; }
.pd-filter-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--brand, #10b981); color: #fff;
  border-radius: 999px; font-size: .7rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.pd-import-btn .pd-btn-label, .pd-new-btn .pd-btn-label { display: inline; }

/* Filter modal */
.pd-filter-modal .modal { max-width: 400px; }
.pd-filter-modal .modal-body { padding: 4px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.pd-filter-modal .field { display: flex; flex-direction: column; gap: 6px; }
.pd-filter-modal .field > span { font-size: .85rem; font-weight: 600; }
.pd-filter-modal .field select {
  padding: 10px 12px; border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px; font-size: .92rem; background: #fff; min-height: 44px;
}
.pd-filter-modal .modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px 20px; }
.pd-filter-modal .modal-foot .btn { min-height: 44px; }

/* Refined bulk bar */
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; flex-wrap: wrap; }
.bulk-bar .bulk-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.bulk-bar select { padding: 8px 10px; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; font-size: .88rem; min-height: 40px; }

/* Orders bulk delete */
.order-check-wrap { display: flex; align-items: center; gap: 10px; }
.order-row-check { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; accent-color: var(--red, #dc2626); }
#orderBulkDeleteBtn:disabled { opacity: .45; cursor: not-allowed; }

/* Mobile toolbar + bottom-sheet filter */
@media (max-width: 640px) {
  .pd-toolbar { gap: 8px; }
  .pd-search { flex: 1 1 100%; order: 1; }
  .pd-filter-btn { order: 2; flex: 0 0 auto; }
  .pd-import-btn, .pd-new-btn { order: 3; flex: 1 1 auto; justify-content: center; }
  .pd-import-btn .pd-btn-label, .pd-new-btn .pd-btn-label { display: inline; }
  .pd-filter-modal { align-items: flex-end; padding: 0; }
  .pd-filter-modal .modal {
    width: 100%; max-width: 100%; margin: 0;
    border-radius: 18px 18px 0 0; max-height: 88dvh;
    display: flex; flex-direction: column;
  }
  .pd-filter-modal .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .pd-filter-modal .modal-foot { flex-direction: column-reverse; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .pd-filter-modal .modal-foot .btn { width: 100%; justify-content: center; }
}
@media (max-width: 430px) {
  .pd-import-btn .pd-btn-label { display: none; }
  .pd-import-btn, .pd-new-btn { padding-left: 10px; padding-right: 10px; }
}

/* Refined mobile product cards */
@media (max-width: 899px) {
  .pcard { padding: 12px; gap: 10px; }
  .pcard-name { font-size: .95rem; line-height: 1.35; word-break: break-word; }
  .pcard-price { font-size: 1rem; font-weight: 700; white-space: nowrap; }
  .pcard-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .pcard-actions .btn { flex: 1 1 calc(50% - 3px); justify-content: center; min-height: 40px; font-size: .82rem; }
}

/* Desktop table polish */
@media (min-width: 900px) {
  .page-products .table th, .page-products .table td { padding: 10px 12px; }
  .page-products .table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
}

/* Products: independent scroll for list */
.pd-scroll {
  /* Show 8 products, then scroll */
  max-height: 600px;
  min-height: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
@media (max-width: 640px) {
  .pd-scroll {
    /* Mobile: 8 cards visible */
    max-height: 70dvh;
  }
}
.pd-scroll::-webkit-scrollbar { width: 6px; }
.pd-scroll::-webkit-scrollbar-thumb { background: var(--border, #e2e8f0); border-radius: 3px; }

/* Centered modal (for View/Edit) */
.pd-modal-backdrop.pd-wide .pd-modal { max-width: 880px; }
.pd-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.pd-modal-backdrop[hidden] { display: none; }
.pd-modal {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 560px; max-height: 88dvh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: pdModalIn .2s ease-out;
}
@keyframes pdModalIn {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.pd-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border, #e2e8f0);
}
.pd-modal-head h3 { margin: 0; font-size: 1.05rem; }
.pd-modal-body { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pd-modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border, #e2e8f0);
}
@media (max-width: 640px) {
  .pd-modal-backdrop { align-items: flex-end; padding: 0; }
  .pd-modal { max-width: 100%; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .pd-modal-foot { flex-direction: column-reverse; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .pd-modal-foot .btn { width: 100%; justify-content: center; min-height: 44px; }
}

/* --- Categories page: topbar, filter, cards --- */
.cat-topbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.cat-topbar .page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-type-filter {
  padding: 10px 12px; border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px; font-size: .92rem; background: #fff;
  min-height: 44px; white-space: nowrap;
}
.cat-type-filter:focus { outline: 2px solid var(--brand, #10b981); outline-offset: -1px; border-color: var(--brand, #10b981); }

/* Mobile category cards: clean grid layout */
@media (max-width: 899px) {
  .cat-topbar { justify-content: stretch; }
  .cat-topbar .page-head-actions { width: 100%; }
  .cat-topbar .page-head-actions .btn,
  .cat-topbar .page-head-actions form { flex: 1; }
  .cat-topbar .page-head-actions .btn { justify-content: center; }
  #catToolbar .pd-search { flex: 1 1 100%; }
  #catToolbar .cat-type-filter { flex: 1; }
  #catToolbar #catCount { flex: 1 1 100%; text-align: right; }
  /* Category cards: dedicated simple layout (no app-list grid conflicts) */
  .cat-cards { display: flex; flex-direction: column; gap: 10px; }
  .cat-card {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px; background: var(--bg, #fff);
    border: 1px solid var(--line, #e2e8f0); border-radius: 12px;
  }
  .cat-card .icon-wrap { flex-shrink: 0; margin-top: 2px; }
  .cat-card-main { flex: 1; min-width: 0; }
  .cat-card-title { display: block; font-size: .95rem; margin-bottom: 2px; }
  .cat-card-meta { margin-top: 6px; }
  .cat-card-actions { display: flex; gap: 8px; margin-top: 10px; }
  .cat-card-actions .btn, .cat-card-actions form { flex: 1; }
  .cat-card-actions .btn { width: 100%; justify-content: center; }
}

/* Desktop: category table polish */
@media (min-width: 900px) {
  .cat-topbar { margin-bottom: 14px; }
  #catToolbar { margin-bottom: 16px; }
}

/* --- Categories: single-row topbar (desktop) --- */
.cat-topbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.cat-search-inline { flex: 0 1 260px; min-width: 180px; }
.cat-topbar .page-head-actions { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 899px) {
  .cat-topbar { gap: 8px; }
  .cat-search-inline { flex: 1 1 100%; order: 1; }
  .cat-topbar .cat-type-filter { flex: 1 1 100%; order: 2; }
  .cat-topbar .page-head-actions {
    order: 3; flex: 1 1 100%; margin-left: 0;
    display: flex; gap: 8px;
  }
  .cat-topbar .page-head-actions > *,
  .cat-topbar .page-head-actions form { flex: 1 1 0; min-width: 0; }
  .cat-topbar .page-head-actions .btn {
    width: 100%; justify-content: center;
    white-space: nowrap; font-size: .85rem; padding-left: 8px; padding-right: 8px;
  }
}

/* --- Categories: independent list scroll (desktop + mobile) --- */
.cat-scroll {
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.cat-scroll::-webkit-scrollbar { width: 6px; }
.cat-scroll::-webkit-scrollbar-thumb { background: var(--border, #e2e8f0); border-radius: 3px; }
/* Sticky table header while scrolling */
.cat-scroll thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--card, #fff);
}
@media (max-width: 899px) {
  .cat-scroll { max-height: 70dvh; }
}

/* --- Orders: filter pills polish (desktop) --- */
.order-filters-card { padding: 14px; }
.order-filters-card .filters { margin-bottom: 0; }
.order-filters-card .chip {
  padding: 9px 18px; font-size: .9rem;
  transition: all .15s ease; min-height: 40px;
}
.order-filters-card .chip.on {
  box-shadow: 0 2px 8px rgba(16,185,129,.3);
}
/* Mobile chip grid handled in "Orders page layout fixes" below */

/* --- Order Detail Popup (global) — premium modern design --- */
.op-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: opFadeIn .2s ease;
}
@media (min-width: 641px) {
  .op-backdrop { align-items: center; padding: 20px; }
}
@keyframes opFadeIn { from { opacity: 0; } to { opacity: 1; } }
.op-modal {
  background: var(--card, #fff);
  width: 100%; max-width: 520px; max-height: 92vh;
  border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  animation: opSlideUp .28s cubic-bezier(.32,.72,.35,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.2);
  overflow: hidden;
}
@media (min-width: 641px) {
  .op-modal { border-radius: 20px; }
}
@keyframes opSlideUp { from { transform: translateY(48px); opacity: .7; } to { transform: none; opacity: 1; } }
.op-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
}
.op-modal-head h3 { margin: 0; font-size: 1.1rem; font-weight: 700; color: #fff; }
.op-modal-head .btn {
  background: rgba(255,255,255,.18); color: #fff; border: none;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; padding: 0;
}
.op-modal-head .btn:hover { background: rgba(255,255,255,.3); }
.op-modal-body { padding: 18px; overflow-y: auto; }
.op-loading { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.op-copy {
  width: 36px; height: 36px; border-radius: 10px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 1rem; cursor: pointer; flex-shrink: 0;
  transition: all .15s ease;
}
.op-copy:hover { background: var(--brand); color: #fff; border-color: var(--brand); transform: scale(1.05); }

/* --- Orders page layout fixes --- */
.order-sticky-head {
  position: sticky; top: 0; z-index: 10;
  border-radius: 14px; margin-bottom: 12px;
}
.order-sticky-head .source-tabs { margin-bottom: 10px; }
.order-list-card { padding: 12px; border-radius: 14px; }
.order-scroll {
  max-height: calc(100dvh - 320px);
  min-height: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.order-scroll::-webkit-scrollbar { width: 6px; }
.order-scroll::-webkit-scrollbar-thumb { background: var(--border, #e2e8f0); border-radius: 3px; }
.order-scroll thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--card, #fff);
}
/* Mobile: even chip grid — no orphan full-width chips */
@media (max-width: 640px) {
  .order-sticky-head .filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .order-sticky-head .chip {
    justify-content: center; text-align: center;
    padding: 10px 6px; font-size: .82rem;
    min-height: 42px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  /* Mobile order cards: use base app-list styles (clean, tested) */
  .order-mobile-list {
    padding: 2px;
  }
  .order-mobile-list .app-list-item:active {
    transform: scale(.99);
  }
  /* Order card inner layout (was unstyled → broken mobile layout) */
  .order-mobile-list .app-list-item-main {
    display: flex; flex-direction: column; gap: 3px;
    min-width: 0; flex: 1;
  }
  .order-mobile-list .app-list-item-title {
    display: block; font-size: .95rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .order-mobile-list .app-list-item-meta {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  }
  .order-mobile-list .app-list-item-meta .fraud-review-link {
    font-size: .75rem; white-space: nowrap; cursor: pointer;
    color: var(--brand); text-decoration: underline;
  }
  .order-mobile-list .app-price {
    font-size: 1rem; font-weight: 700;
  }
  /* Order card has 3 children (thumb, main, chevron) — not 4 like contacts */
  .order-mobile-list .app-list-item {
    grid-template-columns: auto 1fr auto;
  }
  .order-scroll { max-height: calc(100dvh - 340px); }
  /* Mobile: natural page scroll (fixed-height container breaks cards) */
  .order-mobile-list.order-scroll {
    max-height: none; min-height: 0; overflow: visible;
  }
}
@media (min-width: 641px) {
  .order-sticky-head .filters { gap: 8px; }
}
.op-contact-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 11px 14px; border-radius: 12px;
  font-size: .9rem; font-weight: 600; text-decoration: none;
  transition: transform .1s ease, box-shadow .15s ease;
  min-height: 44px;
}
.op-contact-btn:active { transform: scale(.97); }
.op-call {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff; box-shadow: 0 2px 8px rgba(2,132,199,.3);
}
.op-wa {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff; box-shadow: 0 2px 8px rgba(22,163,74,.3);
}
.op-call:hover, .op-wa:hover { filter: brightness(1.05); }
.order-search-input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line, #e2e8f0);
  font-size: .9rem; background: var(--bg, #f8fafc);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.order-search-input:focus {
  outline: none; border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
  background: #fff;
}
.order-search-input::placeholder { color: #94a3b8; }

/* --- Orders: compact layout (plan) --- */
.orders-page .orders-head { margin-bottom: 10px; }
.orders-title {
  font-size: 1.15rem; font-weight: 700; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.orders-count {
  background: #10B981; color: #fff; font-size: .8rem;
  padding: 2px 10px; border-radius: 20px; font-weight: 600;
}
.order-toolbar-row {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.order-toolbar-row .order-search-input { flex: 1; margin: 0; }
.order-filter-btn {
  flex-shrink: 0; white-space: nowrap; min-height: 44px;
}
.order-source-seg { margin-bottom: 10px; }
.order-compact-row {
  display: flex; gap: 8px;
}
.order-mini-select {
  flex: 1; min-width: 0; padding: 9px 8px; font-size: .82rem;
  border-radius: 10px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- Filter popup (bottom sheet) --- */
.fp-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fpFadeIn .2s ease;
}
.fp-backdrop[hidden] { display: none; }
@keyframes fpFadeIn { from { opacity: 0; } to { opacity: 1; } }
.fp-sheet {
  background: var(--bg, #fff); width: 100%; max-width: 480px;
  max-height: 85dvh; border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  animation: fpSlideUp .25s ease;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@keyframes fpSlideUp { from { transform: translateY(40px); opacity: .8; } to { transform: none; opacity: 1; } }
.fp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line, #e2e8f0);
}
.fp-head h3 { margin: 0; font-size: 1.05rem; }
.fp-body {
  padding: 14px 18px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 4px;
}
.fp-label {
  font-size: .82rem; font-weight: 600; color: var(--muted, #64748b);
  margin: 10px 0 6px;
}
.fp-label:first-child { margin-top: 0; }
.fp-source { margin-bottom: 4px; }
.fp-select { width: 100%; padding: 11px 12px; border-radius: 12px; }
.fp-foot {
  display: flex; gap: 10px; padding: 14px 18px;
  border-top: 1px solid var(--line, #e2e8f0);
}
.fp-foot .btn { flex: 1; min-height: 46px; }
@media (min-width: 641px) {
  .fp-backdrop { align-items: center; padding: 20px; }
  .fp-sheet { border-radius: 20px; max-height: 90dvh; }
}

/* --- Fix: WooCommerce chip text overflow --- */
.order-source-seg {
  display: flex; gap: 8px;
}
.order-source-seg .chip {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-left: 8px; padding-right: 8px;
}
@media (max-width: 640px) {
  .order-source-seg .chip { font-size: .8rem; }
}

/* --- Dashboard: compact hero --- */
.dash-hero.compact-hero .hero-inner { padding: 16px 18px; }
.dash-hero.compact-hero h1 { font-size: 1.1rem; margin: 0 0 4px; }
.dash-hero.compact-hero .hero-date { font-size: .82rem; margin: 0 0 10px; }
.dash-hero.compact-hero .hero-actions { gap: 8px; }
.dash-hero.compact-hero .hero-chips { margin-top: 8px; }
@media (max-width: 640px) {
  .dash-hero.compact-hero .hero-inner { padding: 14px 16px; }
  .dash-hero.compact-hero h1 { font-size: 1rem; }
}

/* --- Order list: product thumbnails --- */
.order-thumb {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line, #e2e8f0);
  background: var(--bg, #f8fafc); flex-shrink: 0;
}
.order-thumb-mobile {
  width: 52px; height: 52px; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line, #e2e8f0);
  background: var(--bg, #f8fafc); flex-shrink: 0;
}
.orders-table td:first-child { width: 56px; padding-right: 4px; }

/* --- Order popup: customer edit + delete --- */
.op-edit-btn {
  background: var(--brand-soft, #ecfdf5); border: 1px solid var(--brand-line, #a7f3d0);
  color: var(--brand-dark, #047857); font-size: .78rem; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; cursor: pointer;
  margin-left: 8px; vertical-align: middle;
}
.op-edit-btn:hover { filter: brightness(.97); }
.op-cust-edit { margin-top: 4px; }
.op-flabel {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--muted, #64748b); margin: 10px 0 5px;
}
.op-flabel:first-child { margin-top: 0; }
.op-cust-edit .input { width: 100%; }
.op-cust-edit textarea.input { resize: vertical; min-height: 70px; }
.op-form-row { display: flex; gap: 10px; margin-top: 12px; }
.op-form-row .btn { flex: 1; min-height: 44px; }
.op-msg { margin-top: 10px; }
.op-msg .alert { margin: 0; padding: 10px 12px; font-size: .85rem; }
.op-danger-zone {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--line, #e2e8f0);
  text-align: center;
}
.op-delete-btn {
  color: #dc2626; border: 1px solid #fecaca; background: #fef2f2;
  padding: 8px 20px; border-radius: 10px; font-weight: 600;
}
.op-delete-btn:hover { background: #fee2e2; }
/* Delete confirmation modal */
.op-del-modal {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; border-radius: inherit;
}
.op-del-modal[hidden] { display: none; }
.op-del-box {
  background: #fff; border-radius: 16px; padding: 22px;
  max-width: 340px; width: 100%; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.op-del-box h4 { margin: 0 0 10px; font-size: 1.05rem; color: #dc2626; }
.op-del-box p { margin: 0 0 6px; font-size: .9rem; color: var(--muted, #64748b); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger:disabled { opacity: .6; }

/* --- Modal refinements: safe areas + delete modal --- */
.op-modal {
  max-height: 92dvh;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.op-modal-head {
  flex-shrink: 0; /* Never shrink, never overlap */
  padding: 14px 18px;
}
.op-modal-body {
  flex: 1; min-height: 0;
  padding: 16px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* Delete modal: fixed within viewport, not absolute in scroll */
.op-del-modal {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
@media (max-width: 640px) {
  .op-modal-body { padding: 14px 16px; }
  .op-modal-head { padding: 12px 16px; }
  .op-modal-head h3 { font-size: 1rem; }
}

/* --- Fix: edit form inputs + delete button sizing --- */
.op-cust-edit .input {
  border-radius: 12px; border: 1px solid var(--line, #e2e8f0);
  padding: 11px 14px; font-size: .92rem;
  background: var(--bg, #f8fafc);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.op-cust-edit .input:focus {
  outline: none; border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
  background: #fff;
}
.op-danger-zone { padding: 16px 14px; }
.op-delete-btn {
  padding: 11px 28px; font-size: .9rem; border-radius: 12px;
  min-height: 44px;
}

/* --- Order popup v2: tabbed design (right reference) --- */
.op2-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.op2-tabs {
  display: flex; gap: 8px; margin-bottom: 14px;
  background: var(--bg, #f8fafc); padding: 6px; border-radius: 14px;
}
.op2-tab {
  flex: 1; border: none; background: transparent;
  padding: 10px 6px; border-radius: 10px;
  font-size: .85rem; font-weight: 600; color: var(--muted, #64748b);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s ease; white-space: nowrap;
}
.op2-tab.on { background: #10B981; color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,.3); }
.op2-card {
  background: var(--card, #fff); border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px; padding: 14px; margin-bottom: 12px;
}
.op2-card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: .95rem; margin-bottom: 10px;
  color: var(--ink, #1e293b);
}
.op2-chev { color: var(--muted, #94a3b8); font-size: 1.1rem; }
.op2-rows { display: flex; flex-direction: column; }
.op2-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line, #f1f5f9);
  font-size: .88rem;
}
.op2-row:last-child { border-bottom: none; }
.op2-ric { width: 24px; text-align: center; flex-shrink: 0; color: var(--muted, #64748b); }
.op2-rlab { flex: 1; color: var(--muted, #64748b); }
.op2-rval { font-weight: 600; text-align: right; }
.op2-total { border-top: 2px solid var(--line, #e2e8f0); margin-top: 4px; padding-top: 12px; }
.op2-tamt { color: #10B981; font-size: 1.05rem; }
/* Customer rows */
.op2-crow {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; font-size: .9rem;
  border-bottom: 1px solid var(--line, #f1f5f9);
}
.op2-crow:last-child { border-bottom: none; }
.op2-crow span:nth-child(2) { flex: 1; }
/* Items */
.op2-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; background: var(--bg, #f8fafc);
  border-radius: 12px; margin-bottom: 8px;
}
.op2-item:last-child { margin-bottom: 0; }
.op2-pimg {
  width: 52px; height: 52px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0); flex-shrink: 0; background: #fff;
}
.op2-pimg-none {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg, #f1f5f9); color: var(--muted, #94a3b8);
}
.op2-pinfo { flex: 1; min-width: 0; }
.op2-pname { font-weight: 600; font-size: .9rem; }
.op2-ptotal { font-weight: 700; font-size: .92rem; }
/* Status + sticky foot */
.op2-status-sel { width: 100%; margin-bottom: 10px; }
.op2-full-btn { width: 100%; min-height: 48px; font-weight: 700; }
.op2-sticky-foot {
  position: sticky; bottom: 0;
  background: var(--card, #fff);
  padding: 12px 0 calc(4px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--line, #e2e8f0);
  margin: 12px -18px -18px; padding-left: 18px; padding-right: 18px;
}
.op2-foot-row { display: flex; gap: 10px; margin-bottom: 10px; }
.op2-foot-row .op-contact-btn { min-height: 48px; }
@media (max-width: 640px) {
  .op2-sticky-foot { margin: 12px -16px -16px; padding-left: 16px; padding-right: 16px; }
  .op2-tab { font-size: .78rem; padding: 9px 4px; }
}

/* --- Nice checkmark badge (replaces ✅ emoji) --- */
.op2-check {
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: -2px; margin-right: 2px;
}
.op2-check svg { display: block; }
.op2-ric .op2-check { margin-right: 0; }

/* --- Fix: status dropdown styling --- */
.op2-status-sel {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-height: 50px;
  border-radius: 12px; border: 1px solid var(--line, #e2e8f0);
  padding: 12px 40px 12px 14px; font-size: .92rem; font-weight: 600;
  background-color: var(--bg, #f8fafc); color: var(--ink, #1e293b);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  cursor: pointer; margin-bottom: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.op2-status-sel:focus {
  outline: none; border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
  background-color: #fff;
}

/* --- Compact badges: fit in one row --- */
.op2-badges { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.op2-badges::-webkit-scrollbar { display: none; }
.op2-badges .pill,
.op2-badges .op-store-badge,
.op2-badges .op-pay-badge {
  white-space: nowrap; flex-shrink: 0;
  font-size: .78rem; padding: 6px 10px;
}
@media (max-width: 640px) {
  .op2-badges .pill,
  .op2-badges .op-store-badge,
  .op2-badges .op-pay-badge {
    font-size: .72rem; padding: 5px 8px;
  }
}

/* --- Clickable order rows --- */
.order-row { cursor: pointer; transition: background .12s ease; }
.order-row:hover { background: var(--bg, #f8fafc); }
.order-id-link {
  color: var(--brand, #10B981); font-weight: 700; text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Remove underline on contact button hover --- */
.op-contact-btn:hover, .op-contact-btn:focus, .op-contact-btn:active {
  text-decoration: none;
}

/* --- WooCommerce page redesign --- */
/* TC-27: the .woo-page { max-width: 1100px } rule was removed — the later
   top-level rule (1200px) always wins at equal specificity. */
.woo-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.woo-fields .field { margin: 0; }
.woo-input-wrap { position: relative; display: flex; align-items: center; }
.woo-input-icon {
  position: absolute; left: 12px; font-size: .9rem; opacity: .6;
  pointer-events: none;
}
.woo-input-wrap input { padding-left: 36px; width: 100%; }
.woo-eye {
  position: absolute; right: 8px; background: none; border: none;
  cursor: pointer; font-size: 1rem; opacity: .6; padding: 4px;
}
.woo-eye:hover { opacity: 1; }
.woo-connect-btn { width: 100%; min-height: 48px; font-size: 1rem; }
/* Help box */
.woo-help-box {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 14px;
  padding: 16px; align-self: start;
}
.woo-help-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #047857; }
.woo-help-steps { margin: 0; padding-left: 20px; font-size: .85rem; color: #374151; }
.woo-help-steps li { margin-bottom: 6px; }
.woo-store-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.text-ok { color: #10B981; } .text-err { color: #dc2626; }

/* Mobile */
@media (max-width: 768px) {
  .woo-connect-grid { grid-template-columns: 1fr; }
  .woo-fields { grid-template-columns: 1fr; }
  .woo-help-box { order: -1; }
  .woo-help-box.collapsed .woo-help-steps { display: none; }
}

/* --- WooCommerce mobile: hardened --- */
@media (max-width: 768px) {
  .woo-page { padding-left: 12px; padding-right: 12px; }
  .woo-connect-card { padding: 14px; }
  .woo-connect-grid { display: flex; flex-direction: column; }
  .woo-help-box { order: -1; width: 100%; margin-bottom: 4px; }
  .woo-fields { display: flex; flex-direction: column; }
  .woo-fields .field { width: 100%; min-width: 0; }
  .woo-input-wrap input { min-width: 0; }
}

/* --- WooCommerce: vibrant icons --- */
.woo-input-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f0fdf4; font-size: .85rem;
  position: absolute; left: 8px; opacity: 1;
}
.woo-input-wrap input { padding-left: 44px; }
.woo-help-head span {
  background: #d1fae5; width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* --- WooCommerce: header removed, help at bottom --- */
.woo-connect-grid { display: block; }
.woo-help-bottom { width: 100%; }
/* TC-27: the 2-column grid-template-columns here and the <=768px
   1-column override below it were removed — the later top-level rule
   sets 1fr at every width. display + gap stay (live). */
.woo-help-bottom .woo-help-steps {
  display: grid; gap: 4px 20px;
}

/* --- WooCommerce: visible icons + full width --- */
/* TC-27: the .woo-page { max-width: none; width: 100% } rule was removed —
   the rule below sets width: 100% and max-width: 1200px, always winning. */

/* --- WooCommerce desktop overflow fixes --- */
.woo-page { max-width: 1200px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.woo-page .card { box-sizing: border-box; max-width: 100%; overflow: hidden; }
/* Help steps: single column sequential */
.woo-help-bottom .woo-help-steps { grid-template-columns: 1fr; max-width: 600px; }

/* --- Knowledge Base redesign --- */
.kb-page { max-width: 900px; margin: 0 auto; }
.kb-add-card { border-top: 4px solid #10B981; }
.kb-add-head, .kb-list-head { display: flex; gap: 14px; margin-bottom: 18px; align-items: flex-start; }
.kb-add-head h3, .kb-list-head h3 { margin: 0 0 4px; font-size: 1.1rem; }
.kb-add-head p, .kb-list-head p { margin: 0; }
.kb-ic-add, .kb-ic-list {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 4px 12px rgba(16,185,129,.25);
}
.kb-ic-list { background: linear-gradient(135deg, #6366f1, #4f46e5); box-shadow: 0 4px 12px rgba(99,102,241,.25); }
.kb-form .field { margin-bottom: 14px; }
.kb-input-wrap { position: relative; }
.kb-input-ic {
  position: absolute; left: 10px; top: 12px;
  width: 28px; height: 28px; border-radius: 8px; font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f0fdf4;
}
.kb-input-wrap input, .kb-input-wrap textarea { padding-left: 46px; width: 100%; box-sizing: border-box; }
.kb-add-btn { width: 100%; min-height: 50px; font-size: 1rem; font-weight: 700; }
/* List */
.kb-list { display: flex; flex-direction: column; gap: 12px; }
.kb-item {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line, #e2e8f0); border-radius: 14px;
  padding: 14px; background: #fff;
  transition: box-shadow .15s ease;
}
.kb-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.kb-item-num {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: #f0fdf4; color: #059669; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.kb-item-body { flex: 1; min-width: 0; }
.kb-q { font-weight: 700; margin-bottom: 8px; font-size: .95rem; }
.kb-a { color: var(--muted, #64748b); font-size: .88rem; line-height: 1.5; }
.kb-qlabel, .kb-alabel {
  display: inline-block; font-size: .68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; margin-right: 8px;
  vertical-align: 1px;
}
.kb-qlabel { background: #dbeafe; color: #1d4ed8; }
.kb-alabel { background: #dcfce7; color: #166534; }
.kb-del {
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px;
  width: 40px; height: 40px; cursor: pointer; font-size: 1rem;
  flex-shrink: 0;
}
.kb-del:hover { background: #fee2e2; }
.kb-empty { text-align: center; padding: 40px 20px; }
.kb-empty-ic { font-size: 3rem; display: block; margin-bottom: 12px; }
.kb-empty h3 { margin: 0 0 8px; }
.kb-empty p { margin: 0; }
@media (max-width: 640px) {
  .kb-item { padding: 12px; }
  .kb-ic-add, .kb-ic-list { width: 44px; height: 44px; font-size: 1.2rem; }
}

/* --- Automation page redesign --- */
.auto-page { max-width: none; }
.auto-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; border-top: 4px solid #f59e0b;
}
.auto-cta-left { display: flex; gap: 14px; align-items: center; }
.auto-cta-left h3 { margin: 0 0 4px; font-size: 1.1rem; }
.auto-cta-left p { margin: 0; }
.auto-ic-new {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 12px rgba(245,158,11,.25);
}
.auto-new-btn { min-height: 48px; white-space: nowrap; }
.auto-empty { text-align: center; padding: 40px 20px; }
.auto-empty-ic { font-size: 3rem; display: block; margin-bottom: 12px; }
.auto-empty h3 { margin: 0 0 8px; }
.auto-empty p { margin: 0; }
.auto-list { display: flex; flex-direction: column; gap: 12px; }
.auto-card {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--line, #e2e8f0); border-radius: 14px;
  padding: 16px; background: #fff;
  transition: box-shadow .15s ease;
}
.auto-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.auto-card-num {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: #fffbeb; color: #d97706; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.auto-card-body { flex: 1; min-width: 0; }
.auto-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.auto-name { font-size: 1rem; }
.auto-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.auto-chip {
  background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 20px;
  padding: 4px 12px; font-size: .8rem;
}
.auto-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; }
.auto-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
@media (max-width: 640px) {
  .auto-cta { flex-direction: column; align-items: stretch; }
  .auto-new-btn { width: 100%; text-align: center; }
  .auto-card { flex-direction: column; }
  .auto-actions { width: 100%; }
  .auto-actions .btn, .auto-actions form { flex: 1; text-align: center; }
}

/* --- Automation popup (bottom-sheet mobile / modal desktop) --- */
.ap-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.ap-overlay[hidden] { display: none; }
.ap-sheet {
  background: #fff; width: 100%;
  max-height: 94vh; display: flex; flex-direction: column;
  border-radius: 20px 20px 0 0;
  animation: apUp .22s ease-out;
}
@keyframes apUp {
  from { transform: translateY(40px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
.ap-head {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line, #e2e8f0);
}
.ap-head h3 { margin: 0; font-size: 1.05rem; }
.ap-close {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line, #e2e8f0);
  background: #f8fafc; font-size: 1rem; cursor: pointer;
}
.ap-body {
  overflow-y: auto; padding: 18px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.ap-body .card { margin-bottom: 14px; }
.ap-body .sticky-actions {
  position: sticky; bottom: 0;
  background: #fff; padding: 12px 0 4px;
  display: flex; gap: 10px;
}
.ap-body .sticky-actions .btn { flex: 1; min-height: 50px; }
@media (min-width: 768px) {
  .ap-overlay { align-items: center; padding: 24px; }
  .ap-sheet { max-width: 720px; border-radius: 20px; }
}

/* --- Automation popup: true sheet look on mobile (not full-screen) --- */
.ap-overlay { padding: 12px; box-sizing: border-box; }
.ap-sheet {
  border-radius: 20px;
  max-height: 86vh;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.ap-sheet::before {
  content: '';
  width: 44px; height: 5px; border-radius: 99px;
  background: #e2e8f0;
  margin: 10px auto 2px;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .ap-overlay { padding: 24px; }
  .ap-sheet { max-height: 90vh; }
}

/* --- WhatsApp Templates hub redesign --- */
.tpl-page { max-width: none; }
.tpl-empty { text-align: center; padding: 44px 20px; }
.tpl-empty-ic { font-size: 3rem; display: block; margin-bottom: 12px; }
.tpl-empty h3 { margin: 0 0 8px; }
.tpl-empty p { margin: 0 0 16px; }
.tpl-empty p:last-child { margin-bottom: 0; }
.tpl-acc-card { border-top: 4px solid #25d366; }
.tpl-acc-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.tpl-acc-head h3 { margin: 0 0 4px; font-size: 1.1rem; }
.tpl-acc-head p { margin: 0; }
.tpl-ic-wa {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem;
  background: linear-gradient(135deg, #25d366, #128c7e);
  box-shadow: 0 4px 12px rgba(37,211,102,.3);
}
.tpl-acc-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.tpl-sync-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tpl-sync-btn { min-height: 48px; }
.tpl-filter-card { padding: 14px; }
.tpl-filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tpl-search { flex: 1 1 200px; min-width: 0; min-height: 44px; }
.tpl-filter-row select { min-height: 44px; }
.tpl-list { display: flex; flex-direction: column; gap: 12px; }
.tpl-card {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--line, #e2e8f0); border-radius: 14px;
  padding: 16px; background: #fff;
  transition: box-shadow .15s ease;
}
.tpl-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.tpl-card-num {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: #f0fdf4; color: #128c7e; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.tpl-card-body { flex: 1; min-width: 0; }
.tpl-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tpl-name { font-size: 1rem; }
.tpl-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-chip {
  background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 20px;
  padding: 4px 12px; font-size: .8rem;
}
.tpl-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.tpl-manual-link { margin-top: 16px; }
@media (max-width: 640px) {
  .tpl-card { flex-direction: column; }
  .tpl-actions { width: 100%; }
  .tpl-actions .btn { flex: 1; text-align: center; }
  .tpl-sync-btn { width: 100%; }
  .tpl-ic-wa { width: 44px; height: 44px; font-size: 1.25rem; }
}

/* --- Template create popup --- */
.tpl-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .tpl-2col { grid-template-columns: 1fr; } }

/* --- Broadcast hub (list redesign + create popup) --- */
.bc-page { max-width: none; }
.bc-head-card { border-top: 3px solid #25d366; margin-bottom: 16px; }
.bc-head-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.bc-ic { width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; background: linear-gradient(135deg, #25d366, #128c7e); box-shadow: 0 4px 12px rgba(37, 211, 102, .35); flex-shrink: 0; }
.bc-head-top h3 { margin: 0 0 4px; }
.bc-list { display: grid; gap: 12px; }
.bc-card { display: flex; gap: 14px; align-items: flex-start; background: var(--bg, #fff); border: 1px solid var(--line, #e3eae8); border-radius: 14px; padding: 14px 16px; }
.bc-card-num { width: 34px; height: 34px; border-radius: 10px; background: #eef4f1; color: #128c7e; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bc-card-body { flex: 1 1 auto; min-width: 0; }
.bc-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.bc-name { font-size: 15px; }
.bc-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.bc-chip { display: inline-flex; align-items: center; gap: 5px; background: #f1f5f4; border-radius: 999px; padding: 4px 10px; font-size: 12px; color: #41544e; }
.bc-chip code { font-size: 12px; }
.bc-prog .bar { height: 8px; border-radius: 999px; background: #edf1ef; overflow: hidden; margin-bottom: 6px; }
.bc-prog .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #25d366, #128c7e); transition: width .4s ease; }
.bc-actions { flex-shrink: 0; }
.bc-empty { text-align: center; padding: 40px 20px; }
.bc-empty-ic { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 18px; font-size: 30px; background: linear-gradient(135deg, #25d366, #128c7e); box-shadow: 0 6px 16px rgba(37, 211, 102, .3); margin-bottom: 12px; }
.bc-empty h3 { margin: 0 0 8px; }
@media (max-width: 640px) {
  .bc-card { flex-wrap: wrap; }
  .bc-actions { width: 100%; }
  .bc-actions .btn { width: 100%; }
}

/* --- Broadcast report page --- */
.br-page { max-width: none; }
.br-head-card { border-top: 3px solid #7c6cf0; margin-bottom: 16px; }
.br-head-top { display: flex; gap: 14px; align-items: center; }
.br-ic { width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; background: linear-gradient(135deg, #7c6cf0, #4f46e5); box-shadow: 0 4px 12px rgba(124, 108, 240, .35); flex-shrink: 0; }
.br-head-top h3 { margin: 0 0 4px; }
.br-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 10px; }
.br-stat { text-align: center; padding: 16px 10px; }
.br-stat-ic { font-size: 24px; }
.br-stat-num { font-size: 28px; font-weight: 800; margin: 4px 0 2px; }
.br-stat .bar { height: 6px; border-radius: 999px; background: #edf1ef; overflow: hidden; margin-top: 8px; }
.br-stat .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7c6cf0, #4f46e5); }
.br-note { margin: 0 0 16px; line-height: 1.7; }
.br-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.br-fchip { text-decoration: none; cursor: pointer; }
.br-fchip.on { background: #4f46e5; color: #fff; }
.br-fchip:hover { text-decoration: none; }
.br-pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }
@media (max-width: 900px) { .br-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .br-stats { grid-template-columns: repeat(2, 1fr); } }

/* --- Pixel & Tracking --- */
.px-page { max-width: none; }
.px-empty { text-align: center; padding: 40px 20px; }
.px-empty-ic { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 18px; font-size: 30px; background: linear-gradient(135deg, #7c6cf0, #4f46e5); box-shadow: 0 6px 16px rgba(124, 108, 240, .3); margin-bottom: 12px; }
.px-empty h3 { margin: 0 0 8px; }
.px-filter { margin-bottom: 16px; }
.px-filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.px-filter-actions { display: flex; gap: 10px; align-items: end; }
.px-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 10px; }
.px-stat { text-align: center; padding: 16px 10px; }
.px-stat-ic { font-size: 24px; }
.px-stat-num { font-size: 24px; font-weight: 800; margin: 4px 0 2px; }
.px-note { margin: 0 0 16px; line-height: 1.7; }
.px-stores { display: grid; gap: 12px; }
.px-store-card { padding: 16px; }
.px-store-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.px-setup-card { margin-bottom: 16px; }
.px-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.px-fieldset { border: 1px solid var(--line, #e3eae8); border-radius: 12px; padding: 12px 14px; margin: 14px 0; }
.px-fieldset legend { font-weight: 700; padding: 0 6px; }
.px-checks { display: flex; gap: 8px 16px; flex-wrap: wrap; }
.px-check { display: inline-flex; align-items: center; gap: 6px; }
.px-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line, #e3eae8); }
.px-ev-list { display: grid; gap: 12px; }
.px-ev-card { background: var(--bg, #fff); border: 1px solid var(--line, #e3eae8); border-radius: 14px; padding: 14px 16px; }
.px-ev-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.px-ev-mono { font-family: ui-monospace, monospace; word-break: break-all; }
.px-ev-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.px-pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }
.px-detail { margin-bottom: 16px; }
.px-dl > div { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line, #e3eae8); }
.px-dl dt { min-width: 140px; font-weight: 700; }
.px-dl dd { margin: 0; word-break: break-all; }
.px-mono { font-family: ui-monospace, monospace; }
.px-pre { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.px-table { width: 100%; border-collapse: collapse; }
.px-table th, .px-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line, #e3eae8); }
.px-diag { line-height: 1.8; }
.px-diag li { margin-bottom: 6px; }
.px-test-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.px-test-card { padding: 16px; }
.px-snippet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
@media (max-width: 900px) { .px-stats { grid-template-columns: repeat(3, 1fr); } .px-filter-grid { grid-template-columns: repeat(2, 1fr); } .px-test-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .px-stats { grid-template-columns: repeat(2, 1fr); } .px-2col { grid-template-columns: 1fr; } .px-filter-grid { grid-template-columns: 1fr; } }

/* Fraud settings page only (fg-* classes are used solely by views/fraud_settings.ejs). */
.fg-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fg-group { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.fg-group h5 { margin: 0 0 12px; font-size: 0.95rem; }
.fg-field { display: block; margin-bottom: 12px; }
.fg-field:last-child { margin-bottom: 0; }
.fg-field input { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; }
@media (max-width: 1100px) { .fg-groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .fg-groups { grid-template-columns: 1fr; } }

/* WooCommerce tab bar (partials/woo_tabs.ejs) — scoped, no global rule changed */
.woo-tabs-card { margin-bottom: 16px; }
.woo-tabs-store { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.woo-tabs-store .input { max-width: 320px; }
.woo-tabs-store select { flex: 1 1 200px; min-width: 0; }
.woo-tabs-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; -ms-overflow-style: none; }
.woo-tabs-row::-webkit-scrollbar { display: none; }
.woo-tabs-row .chip { white-space: nowrap; flex-shrink: 0; }

/* Fraud blocklist/allowlist forms — mobile only: stack full-width.
   Desktop row layout is unchanged. !important beats the inputs' inline
   max-width styles, but only inside this mobile block. */
@media (max-width: 640px) {
  .fg-list-form { flex-direction: column; }
  .fg-list-form input { width: 100% !important; max-width: none !important; min-width: 0; box-sizing: border-box; }
  .fg-list-form .btn { width: 100%; }
}

/* Fraud page premium liquid look — scoped to .fraud-liquid (fraud_settings.ejs only).
   Layout, sizes, labels and behaviour are unchanged; only the surface is glass. */
.fraud-liquid {
  background:
    radial-gradient(600px 300px at 85% -60px, rgba(18,140,126,0.20), transparent 70%),
    radial-gradient(500px 260px at -60px 0, rgba(18,140,126,0.16), transparent 70%),
    radial-gradient(700px 400px at 50% 110%, rgba(18,140,126,0.12), transparent 70%),
    linear-gradient(180deg, #e2f5ec 0%, #f2fbf6 30%, #ffffff 55%, #e9f6f0 100%);
}
.fraud-liquid .card {
  background: rgba(255,255,255,0.68);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(18,140,126,0.20);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(7,94,84,0.16), 0 2px 8px rgba(31,41,55,0.06), inset 0 1px 0 rgba(255,255,255,0.85);
}
.fraud-liquid h1 { color: var(--brand-ink); }
.fraud-liquid .fg-group {
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(18,140,126,0.16);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.fraud-liquid .input {
  background: rgba(255,255,255,0.85);
  border-color: rgba(18,140,126,0.28);
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(31,41,55,0.05);
  box-sizing: border-box;
  padding: 10px 12px;
  font: inherit;
}
.fraud-liquid .input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(18,140,126,0.18), inset 0 1px 2px rgba(31,41,55,0.05);
  outline: none;
}
.fraud-liquid .btn {
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(7,94,84,0.28), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: filter 0.15s ease;
}
.fraud-liquid .btn:hover { filter: brightness(1.06); }
.fraud-liquid .btn-soft {
  background: rgba(255,255,255,0.8);
  border-color: rgba(18,140,126,0.3);
  color: var(--brand-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.fraud-liquid .woo-tabs-row .chip:not(.on) {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.8);
}
.fraud-liquid .table thead th { background: rgba(230,244,241,0.7); }
.fraud-liquid .table tbody tr:hover td { background: rgba(230,244,241,0.35); }

/* Fraud list forms — desktop only: fill the row, expiry label gap (mobile keeps stacked full-width). */
@media (min-width: 641px) {
  .fraud-liquid .fg-list-form input[name="phone"],
  .fraud-liquid .fg-list-form input[name="reason"],
  .fraud-liquid .fg-list-form input[name="note"] { flex: 1 1 200px; min-width: 0; }
  .fraud-liquid .fg-list-form label { display: inline-flex; gap: 8px; align-items: center; }
  .fraud-liquid .fg-list-form input[name="expiry_days"] { width: 140px; flex: none; }
}

/* ---- Manual payments (billing) — scoped, mobile-first ---- */
.alert.warn { border-left-color: var(--amber, #d97706); background: color-mix(in srgb, var(--amber, #d97706) 8%, transparent); }
.manual-pay .mp-nums { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.manual-pay .mp-nums li { display: flex; align-items: center; gap: 10px; }
.manual-pay .mp-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.manual-pay .mp-form label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; }
.manual-pay .mp-form input,
.manual-pay .mp-form select {
  width: 100%; padding: 10px 12px; font: inherit; font-weight: 400;
  border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: inherit;
  box-sizing: border-box;
}
.manual-pay .mp-form input:focus,
.manual-pay .mp-form select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
@media (min-width: 720px) {
  .manual-pay .mp-form { display: grid; grid-template-columns: 1fr 1fr; }
  .manual-pay .mp-form button { grid-column: 1 / -1; }
}

/* ---- Spam country-gate settings — scoped, mobile-first ---- */
.spam-settings .fld { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; font-size: .9rem; }
.spam-settings .fld > span { font-weight: 600; }
.spam-settings select {
  width: 100%; padding: 10px 12px; font: inherit; font-weight: 400;
  border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: inherit;
  box-sizing: border-box;
}
.spam-settings select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.spam-settings select[multiple] { min-height: 150px; }

/* ==========================================================================
   BILLING — clean redesign (2026-11-04)
   ========================================================================== */
.billing-hero {
  background: linear-gradient(135deg, #075e54 0%, #0b7a6c 55%, #12a08d 100%);
  border: none; color: #fff; overflow: hidden;
}
.billing-hero-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.billing-hero-label { font-size: .8rem; opacity: .85; margin-bottom: 4px; }
.billing-hero-plan { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.billing-hero-status { margin-top: 8px; }
.billing-hero-icon {
  background: rgba(255,255,255,.18); color: #fff;
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
}
.billing-hero-stats {
  display: flex; gap: 24px; margin: 18px 0 12px; flex-wrap: wrap;
}
.billing-hero-stat .num { font-size: 1.25rem; font-weight: 700; }
.billing-hero-stat .num .dim { font-weight: 400; opacity: .75; font-size: 1rem; }
.billing-hero-stat .lbl { font-size: .78rem; opacity: .8; margin-top: 2px; }
.billing-hero-bar { background: rgba(255,255,255,.25); border-radius: 99px; height: 8px; overflow: hidden; }
.billing-hero-bar .fill { height: 100%; border-radius: 99px; }
.billing-hero-quota { margin: 8px 0 0; font-size: .85rem; opacity: .9; }

.billing-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; margin: 28px 0 12px;
}
.billing-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

/* Features: compact collapsible */
.billing-features summary {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; list-style: none; padding: 4px 0;
}
.billing-features summary::-webkit-details-marker { display: none; }
.billing-features summary .spacer { flex: 1; }
.billing-features-body { margin-top: 12px; }
.billing-features-body h4 {
  font-size: .9rem; margin: 14px 0 8px; color: var(--ink-soft);
}
.billing-features-body h4:first-child { margin-top: 0; }
.billing-feature-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.billing-feature-pills .pill { font-size: .78rem; }

/* Current plan card highlight */
.price-card.current { border: 2px solid var(--ok); }

/* ==========================================================================
   PRICING CARDS — dynamic (2026-11-04)
   ========================================================================== */
.pricing-grid .price-card {
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative; overflow: hidden;
}
.pricing-grid .price-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(79, 70, 229, .16);
  border-color: var(--brand);
}
.pricing-grid .price-card.hot {
  border: 2px solid var(--brand);
  box-shadow: 0 8px 24px rgba(79, 70, 229, .12);
}
.pricing-grid .price-card.hot:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 40px rgba(79, 70, 229, .22);
}
.pricing-grid .price-card.current {
  border: 2px solid var(--ok);
  background: linear-gradient(180deg, rgba(16,185,129,.06) 0%, transparent 120px);
}
.pricing-grid .price-card.current::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #10b981, #34d399);
}
.pricing-grid .price-card .amount {
  transition: transform .25s ease;
}
.pricing-grid .price-card:hover .amount {
  transform: scale(1.03);
}
.pricing-grid .price-card ul li {
  transition: transform .15s ease, background .15s ease;
  border-radius: 6px; padding: 2px 4px; margin: 0 -4px;
}
.pricing-grid .price-card ul li:hover {
  transform: translateX(4px);
  background: var(--brand-soft);
}
.pricing-grid .price-card .btn {
  transition: transform .15s ease, box-shadow .15s ease;
}
.pricing-grid .price-card .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, .25);
}
.pricing-grid .price-card .btn:active:not(:disabled) {
  transform: translateY(0);
}
.pricing-grid .price-card .flag {
  animation: flagPulse 2s ease-in-out infinite;
}
@keyframes flagPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Pricing card: collapsible features on mobile */
.price-more-btn {
  background: none; border: none; cursor: pointer;
  color: var(--brand); font-size: .85rem; font-weight: 600;
  padding: 4px 0; display: inline-flex; align-items: center; gap: 4px;
}
.price-more-btn:hover { text-decoration: underline; }
.price-more-wrap { list-style: none; }
/* hidden attribute must win over the flex display on li */
.price-card ul li[hidden] { display: none !important; }
@media (min-width: 900px) {
  /* Desktop: show all features, hide toggle */
  .price-card .price-extra { display: flex !important; }
  .price-card .price-more-wrap { display: none !important; }
}

/* WooCommerce dashboard */
.woo-stores { display: flex; flex-direction: column; gap: 8px; }
.woo-store-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: var(--bg-soft); border-radius: 10px; gap: 8px;
}
.woo-store-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.woo-store-stats { display: flex; gap: 12px; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.woo-store-stats b { color: var(--text); }
.stat-prem .sub { font-size: .78rem; color: var(--brand-dark); font-weight: 600; margin-top: 2px; }

/* Compact WooCommerce dashboard cards */
.woo-store-row {
  padding: 7px 10px;
}
.woo-store-row .woo-store-name {
  font-size: .82rem;
}
.woo-store-stats {
  font-size: .76rem;
  gap: 8px;
}
/* Top products: max 3 visible, rest in scroll */
.woo-top-products {
  max-height: 132px;
  overflow-y: auto;
}

/* Order filters: clear visual separation between groups */
.order-filter-card {
  display: flex; flex-direction: column; gap: 0;
  padding: 10px 12px;
}
.order-filter-group {
  display: flex; flex-direction: column; gap: 6px;
}
.order-filter-label {
  font-size: .72rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.order-source-seg { margin-bottom: 0; }
.order-compact-row { margin-top: 2px; }

/* Mobile: collapse filter groups, expand via toggle */
/* TC-27: max-height/opacity/transition were removed from this base rule —
   the later plain .order-filter-groups rule always wins those properties
   at equal specificity (mobile collapse, B4/TC-10 re-shows layer on top). */
.order-filter-groups {
  display: flex; flex-direction: column; gap: 12px;
  overflow: hidden;
}
@media (max-width: 767px) {
  .order-filter-card:not(.expanded) .order-filter-groups {
    max-height: 0;
    opacity: 0;
    margin: 0;
  }
  .order-filter-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 10px 12px; margin-top: 8px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 10px; font-size: .85rem; font-weight: 600;
    cursor: pointer; color: var(--text);
  }
  .order-filter-toggle .toggle-arrow {
    transition: transform .2s;
  }
  .order-filter-card.expanded .toggle-arrow {
    transform: rotate(180deg);
  }
  .order-filter-active-count {
    background: var(--brand); color: #fff;
    font-size: .7rem; padding: 2px 8px; border-radius: 10px;
    margin-left: 6px;
  }
}
@media (min-width: 768px) {
  .order-filter-toggle { display: none; }
  .order-filter-groups { display: flex !important; }
}

.order-toolbar-row {
  margin-bottom: 0;
}
.order-filter-toggle {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: .8rem;
  border-radius: 8px;
  background: transparent;
  border: 1px dashed var(--border);
}
.order-filter-toggle:hover {
  background: var(--surface2);
  border-style: solid;
}
.order-filter-card.expanded .order-filter-toggle {
  border-style: solid;
  background: var(--surface2);
  margin-bottom: 10px;
}
.order-filter-groups {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .25s ease, opacity .2s ease, margin .2s ease;
}
.order-filter-card.expanded .order-filter-groups {
  max-height: 500px;
  opacity: 1;
}
.order-filter-label {
  font-size: .68rem;
  margin-bottom: 2px;
}
/* Active filter chips row */
.order-active-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.order-active-chips:empty { display: none; }
.active-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600;
  padding: 4px 8px; border-radius: 20px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}
.active-chip button {
  background: none; border: none; cursor: pointer;
  font-size: .8rem; line-height: 1; padding: 0;
  color: inherit; opacity: .7;
}
.active-chip button:hover { opacity: 1; }
/* Compact order cards */
.app-list-item {
  padding: 10px 12px;
}
.order-thumb-mobile {
  width: 52px; height: 52px;
}

/* Remove ugly focus outline on filter toggle */
.order-filter-toggle:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 20%, transparent);
}
.order-filter-toggle:active {
  transform: scale(.98);
}
/* Professional compact order list */
.order-check-wrap {
  margin-bottom: 8px;
}
.app-list-item {
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.app-list-item:active {
  transform: scale(.99);
}
.app-list-item-title {
  font-size: .88rem;
}
.app-list-item-meta {
  margin-top: 6px;
}
.order-thumb-mobile {
  border-radius: 10px;
}

/* Long-press selection mode (WhatsApp/Gmail style) */
.order-check-wrap {
  position: relative;
  margin-bottom: 8px;
}
.order-select-check {
  display: none;
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  width: 26px; height: 26px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  align-items: center; justify-content: center;
  color: transparent;
}
.order-select-check svg {
  width: 14px; height: 14px;
}
.order-select-check input {
  display: none;
}
body.select-mode .order-select-check {
  display: flex;
}
body.select-mode .order-check-wrap.selected .app-list-item {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border-color: var(--brand);
}
body.select-mode .order-check-wrap.selected .order-select-check {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
/* Selection toolbar */
.order-select-bar {
  display: none;
  position: sticky; top: 0; z-index: 10;
  align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
body.select-mode .order-select-bar {
  display: flex;
}
.order-select-count {
  font-weight: 700; font-size: .9rem;
  background: var(--brand); color: #fff;
  min-width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  padding: 0 6px;
}
.order-select-exit {
  margin-left: auto;
  background: none; border: none;
  font-size: 1.2rem; cursor: pointer;
  color: var(--muted); padding: 4px 8px;
}

/* Hide old bulk bar on mobile (replaced by long-press selection) */
@media (max-width: 767px) {
  #orderBulkBar { display: none; }
  .order-check-wrap { display: block; }
}

/* ===== Bubble Bottom Navigation (reference design) ===== */
.bottomnav {
  position: fixed;
  bottom: env(safe-area-inset-bottom);
  left: 16px; right: 16px;
  display: flex;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  padding: 4px 2px 8px;
  z-index: 60;
}
.bottomnav a {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  gap: 2px;
  position: relative;
  padding: 4px 0 2px;
  color: var(--muted, #9ca3af);
  text-decoration: none;
  font-size: .64rem;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}
.bottomnav a small {
  font-size: .62rem;
  font-weight: 500;
  transition: color .25s, font-weight .25s;
  line-height: 1.2;
}
.nav-bubble {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  transition: transform .3s cubic-bezier(.34,1.4,.64,1), background .25s, color .25s, box-shadow .25s;
  color: var(--muted, #9ca3af);
}
.nav-bubble svg {
  width: 20px; height: 20px;
}
/* Active: bubble pops up */
.bottomnav a.on {
  color: var(--text, #111);
}
.bottomnav a.on small {
  font-weight: 700;
  color: var(--text, #111);
}
.bottomnav a.on .nav-bubble {
  transform: translateY(-14px);
  background: var(--brand, #0d9488);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  border: 3px solid var(--surface, #fff);
  width: 48px; height: 48px;
}
.bottomnav a.on .nav-bubble svg {
  width: 22px; height: 22px;
}
/* Concave notch curves on either side of active bubble */
.bottomnav a.on::before,
.bottomnav a.on::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 18px; height: 18px;
  z-index: 1;
}
.bottomnav a.on::before {
  left: calc(50% - 32px);
  background: radial-gradient(circle at 0 0, transparent 68%, var(--surface, #fff) 70%);
}
.bottomnav a.on::after {
  right: calc(50% - 32px);
  background: radial-gradient(circle at 100% 0, transparent 68%, var(--surface, #fff) 70%);
}
/* Press feedback */
.bottomnav a:active .nav-bubble {
  transform: scale(.9);
}
.bottomnav a.on:active .nav-bubble {
  transform: translateY(-14px) scale(.9);
}
/* Content padding for floating nav */
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

/* Collapsible connect form */
.woo-connect-toggle {
  display: none;
  width: 100%;
  align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: none; border: none;
  font-size: .9rem; font-weight: 700;
  cursor: pointer; color: var(--text);
}
.woo-connect-toggle .toggle-arrow {
  transition: transform .2s;
}
.woo-connect-card.collapsed .woo-connect-toggle {
  display: flex;
}
.woo-connect-card.collapsed .woo-connect-body {
  display: none;
}
.woo-connect-card.expanded .woo-connect-body {
  display: block;
}
.woo-connect-card.expanded .toggle-arrow {
  transform: rotate(180deg);
}
.woo-connect-card.collapsed {
  padding: 0;
}

/* Sync button loading state */
.woo-sync-btn.syncing {
  opacity: .7;
  pointer-events: none;
}
.woo-sync-btn.syncing svg {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.8); }
}

/* ===== Reference Store Card Design ===== */
.woo-ref-card {
  margin-bottom: 20px;
}
/* Header: dark green gradient */
.woo-ref-head {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 20px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 45%, #134e4a 100%);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(15,118,110,.3);
}
.woo-ref-head::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.woo-ref-head::after {
  content: '';
  position: absolute;
  right: 60px; bottom: -60px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.woo-ref-logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  font-weight: 800; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative; z-index: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.woo-ref-head-info {
  flex: 1; min-width: 0;
  position: relative; z-index: 1;
}
.woo-ref-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  display: block;
  letter-spacing: -.01em;
}
.woo-ref-sub {
  font-size: .82rem;
  color: rgba(255,255,255,.85);
  margin-top: 3px;
  display: flex; align-items: center; gap: 6px;
}
.woo-ref-live {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.18);
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  color: #fff;
}
.woo-ref-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74,222,128,.3);
}
.woo-ref-url {
  display: flex; align-items: center; gap: 5px;
  font-size: .8rem;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  margin-top: 6px;
}
.woo-ref-url svg { width: 14px; height: 14px; }
.woo-ref-menu-wrap {
  position: relative; z-index: 2;
}
.woo-ref-menu-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.woo-ref-menu {
  position: absolute;
  right: 0; top: 42px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 6px;
  min-width: 150px;
  z-index: 10;
}
.woo-ref-menu button {
  width: 100%;
  padding: 10px 12px;
  background: none; border: none;
  text-align: left;
  font-size: .85rem;
  cursor: pointer;
  border-radius: 8px;
  color: #dc2626;
}
.woo-ref-menu button:hover {
  background: #fef2f2;
}
/* Stats: horizontal */
.woo-ref-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.woo-ref-stat {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px;
  border-radius: 16px;
}
.woo-ref-stat.st-green { background: #ecfdf5; }
.woo-ref-stat.st-purple { background: #f5f3ff; }
.woo-ref-stat.st-blue { background: #eff6ff; }
.woo-ref-stat-ic {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.woo-ref-stat-ic svg { width: 20px; height: 20px; }
.st-green .woo-ref-stat-ic { background: #d1fae5; color: #059669; }
.st-purple .woo-ref-stat-ic { background: #ede9fe; color: #7c3aed; }
.st-blue .woo-ref-stat-ic { background: #dbeafe; color: #2563eb; }
.woo-ref-stat-tx {
  display: flex; flex-direction: column;
  min-width: 0;
}
.woo-ref-stat-tx strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
}
.woo-ref-stat-tx small {
  font-size: .74rem;
  color: #6b7280;
  font-weight: 600;
  white-space: nowrap;
}
/* Today bar */
.woo-ref-today {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px;
  margin-top: 14px;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  border-radius: 16px;
  color: #fff;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(15,118,110,.3);
}
.woo-ref-today-left {
  display: flex; align-items: center; gap: 8px;
}
.woo-ref-today-left svg { width: 20px; height: 20px; }
.woo-ref-chevron {
  font-size: 1.4rem;
  opacity: .8;
}
/* Sync info card */
.woo-ref-sync {
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  margin-top: 14px;
  padding: 6px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.woo-ref-sync-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid rgba(0,0,0,.05);
  font-size: .86rem;
}
.woo-ref-sync-row:last-child {
  border-bottom: none;
}
.woo-ref-sync-left {
  display: flex; align-items: center; gap: 8px;
  color: #6b7280;
}
.woo-ref-sync-left svg { width: 18px; height: 18px; }
.woo-ref-sync-right {
  display: flex; align-items: center; gap: 8px;
}
.woo-ref-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800;
}
/* Toggle switch */
.woo-ref-toggle {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
}
.woo-ref-toggle input {
  display: none;
}
.woo-ref-toggle-track {
  width: 44px; height: 24px;
  border-radius: 20px;
  background: #d1d5db;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.woo-ref-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.woo-ref-toggle input:checked + .woo-ref-toggle-track {
  background: #059669;
}
.woo-ref-toggle input:checked + .woo-ref-toggle-track .woo-ref-toggle-thumb {
  left: 22px;
}
/* Actions */
.woo-ref-actions {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.woo-ref-sync-btn {
  width: 100%;
  padding: 15px;
  border-radius: 16px;
  font-size: .95rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  border: none;
  box-shadow: 0 4px 14px rgba(15,118,110,.3);
}
.woo-ref-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}
.woo-ref-actions-row .inline { min-width: 0; }
.woo-ref-actions-row .btn {
  width: 100%;
  border-radius: 14px;
  padding: 12px 8px;
  font-weight: 600;
  font-size: .84rem;
  white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
}
.woo-ref-actions-row .btn-red {
  color: #dc2626;
  border-color: #fecaca;
}
.woo-ref-actions-row .btn svg { flex-shrink: 0; }
/* Quick access */
.woo-ref-qa {
  margin-top: 22px;
}
.woo-ref-qa-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.woo-ref-qa-head strong {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}
.woo-ref-qa-head a {
  font-size: .84rem;
  color: #0d9488;
  text-decoration: none;
  font-weight: 600;
}
.woo-ref-qa-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.woo-ref-qa-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  padding: 18px 4px 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  text-decoration: none;
  color: #111827;
  font-size: .78rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: transform .15s;
}
.woo-ref-qa-item:active {
  transform: scale(.96);
}
.woo-ref-qa-item svg {
  width: 24px; height: 24px;
  color: #0d9488;
}

/* Separate store cards clearly */
.woo-ref-card {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(0,0,0,.06);
}
.woo-ref-card:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
/* SVG icon sizing inside ref card */
.woo-ref-menu-btn svg {
  width: 20px; height: 20px;
}
.woo-ref-chevron svg {
  width: 20px; height: 20px;
}
.woo-ref-check svg {
  width: 13px; height: 13px;
}
.woo-ref-qa-head a {
  display: inline-flex; align-items: center; gap: 2px;
}
.woo-ref-qa-head a svg {
  width: 14px; height: 14px;
}
.woo-ref-menu button {
  display: flex; align-items: center; gap: 8px;
  color: #dc2626;
}
.woo-ref-menu button svg {
  width: 16px; height: 16px;
}

/* Each store = ONE distinct card box */
.woo-ref-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 24px;
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
/* Remove the divider approach - the box itself separates */
.woo-ref-card {
  border-bottom: 1px solid rgba(0,0,0,.08);
  padding-bottom: 16px;
}
.woo-ref-card:last-child {
  margin-bottom: 0;
}

/* LAYOUT FIX: prevent overflow outside card */
.woo-ref-card {
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.woo-ref-card > * {
  min-width: 0;
  box-sizing: border-box;
}
.woo-ref-head {
  max-width: 100%;
}
.woo-ref-head-info {
  min-width: 0;
}
.woo-ref-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.woo-ref-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Compact stats to fit 3 columns on mobile */
.woo-ref-stats {
  gap: 8px;
}
.woo-ref-stat {
  padding: 10px 8px;
  gap: 6px;
  min-width: 0;
}
.woo-ref-stat-ic {
  width: 32px; height: 32px;
  border-radius: 10px;
}
.woo-ref-stat-ic svg { width: 16px; height: 16px; }
.woo-ref-stat-tx {
  min-width: 0;
}
.woo-ref-stat-tx strong {
  font-size: .9rem;
}
.woo-ref-stat-tx small {
  font-size: .68rem;
}

/* ===== CONSOLIDATED STORE CARD FIX (overrides all duplicates) ===== */
.woo-ref-card,
.woo-ref-card * {
  box-sizing: border-box;
}
.woo-ref-card {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  padding: 14px !important;
  margin-bottom: 20px !important;
}
/* Header */
.woo-ref-head {
  width: 100% !important;
  max-width: 100% !important;
  padding: 16px !important;
  gap: 12px !important;
}
.woo-ref-logo {
  width: 48px !important; height: 48px !important;
  font-size: .85rem !important;
}
.woo-ref-head-info {
  min-width: 0 !important;
  flex: 1 !important;
}
.woo-ref-name {
  font-size: 1rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.woo-ref-sub {
  font-size: .76rem !important;
  flex-wrap: wrap !important;
}
.woo-ref-url {
  font-size: .74rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.woo-ref-menu-btn {
  width: 32px !important; height: 32px !important;
  flex-shrink: 0 !important;
}
/* Stats - force fit */
.woo-ref-stats {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  margin-top: 12px !important;
}
.woo-ref-stat {
  min-width: 0 !important;
  padding: 10px 6px !important;
  gap: 6px !important;
  overflow: hidden !important;
}
.woo-ref-stat-ic {
  width: 30px !important; height: 30px !important;
  border-radius: 9px !important;
  flex-shrink: 0 !important;
}
.woo-ref-stat-ic svg { width: 15px !important; height: 15px !important; }
.woo-ref-stat-tx {
  min-width: 0 !important;
  overflow: hidden !important;
}
.woo-ref-stat-tx strong {
  font-size: .88rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.woo-ref-stat-tx small {
  font-size: .66rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
/* Today bar */
.woo-ref-today {
  width: 100% !important;
  padding: 13px 14px !important;
  font-size: .84rem !important;
  margin-top: 12px !important;
}
.woo-ref-today-left {
  min-width: 0 !important;
  flex-wrap: wrap !important;
}
/* Sync card */
.woo-ref-sync {
  width: 100% !important;
  padding: 4px 14px !important;
  margin-top: 12px !important;
}
.woo-ref-sync-row {
  font-size: .82rem !important;
  padding: 11px 0 !important;
  gap: 8px !important;
}
.woo-ref-sync-row strong {
  text-align: right !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
/* Actions */
.woo-ref-actions {
  margin-top: 14px !important;
}
.woo-ref-sync-btn {
  padding: 13px !important;
  font-size: .9rem !important;
}
.woo-ref-actions-row {
  gap: 8px !important;
  grid-template-columns: 1fr 1fr auto !important;
}
.woo-ref-actions-row .btn {
  padding: 10px 6px !important;
  font-size: .78rem !important;
}
/* Quick access */
.woo-ref-qa {
  margin-top: 18px !important;
}
.woo-ref-qa-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
}
.woo-ref-qa-item {
  min-width: 0 !important;
  padding: 14px 2px 11px !important;
  font-size: .72rem !important;
  overflow: hidden !important;
}
.woo-ref-qa-item svg {
  width: 20px !important; height: 20px !important;
}

/* ===== Pixel Dashboard: Dynamic ===== */
.px-dyn-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 768px) {
  .px-dyn-grid { grid-template-columns: 1fr; }
}
.px-dyn-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.px-dyn-head h4 { margin: 0; font-size: .95rem; font-weight: 800; }
.px-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; font-weight: 700; color: #16a34a;
  background: #dcfce7; padding: 3px 10px; border-radius: 20px;
}
.px-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  animation: pxPulse 1.6s infinite;
}
@keyframes pxPulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.px-donut-wrap {
  position: relative;
  width: 150px; height: 150px;
  margin: 0 auto;
}
.px-donut { width: 100%; height: 100%; }
.px-donut circle { transition: stroke-dasharray .6s ease, stroke-dashoffset .6s ease; }
.px-donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.px-donut-center strong { font-size: 1.5rem; font-weight: 800; }
.px-donut-center small { color: var(--muted); font-size: .75rem; }
.px-legend {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  justify-content: center;
  margin-top: 14px;
  font-size: .8rem;
}
.px-legend i {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 3px; margin-right: 4px; vertical-align: middle;
}
.px-updated { text-align: center; margin-top: 10px; }
/* Trend bars */
.px-bars {
  display: flex; align-items: flex-end; gap: 8px;
  height: 170px; padding-top: 10px;
}
.px-bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px; min-width: 0;
}
.px-bar-track {
  display: flex; flex-direction: column-reverse;
  justify-content: flex-start;
  height: 120px; width: 100%; max-width: 34px;
  border-radius: 8px 8px 0 0; overflow: hidden;
  background: #f3f4f6;
}
.px-bar-acc { background: linear-gradient(180deg, #22c55e, #16a34a); width: 100%; transition: height .6s ease; }
.px-bar-fail { background: linear-gradient(180deg, #f87171, #dc2626); width: 100%; transition: height .6s ease; }
.px-bar-val { font-size: .78rem; font-weight: 700; }
.px-bar-label { font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ===== Pixel Hero Card ===== */
.px-hero {
  padding: 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 45%, #134e4a 100%);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15,118,110,.35);
}
.px-hero::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.px-hero::after {
  content: '';
  position: absolute;
  right: 70px; bottom: -60px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.px-hero-top {
  display: flex; align-items: center; gap: 14px;
  position: relative; z-index: 1;
  margin-bottom: 18px;
}
.px-hero-ic {
  width: 52px; height: 52px;
  border-radius: 15px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.px-hero-ic svg { width: 24px; height: 24px; }
.px-hero-tx h3 {
  margin: 0;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.px-hero-tx span {
  font-size: .78rem;
  color: rgba(255,255,255,.8);
  font-weight: 600;
}
.px-hero-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  position: relative; z-index: 1;
}
@media (max-width: 640px) {
  .px-hero-actions { grid-template-columns: repeat(2, 1fr); }
}
.px-hero-btn {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 14px 6px 12px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  font-size: .76rem;
  font-weight: 700;
  text-align: center;
  transition: background .15s, transform .15s;
}
.px-hero-btn:hover {
  background: rgba(255,255,255,.24);
}
.px-hero-btn:active {
  transform: scale(.96);
}
.px-hero-btn svg { width: 20px; height: 20px; }

/* ===== Fraud Guard Dynamic ===== */
.fg-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 45%, #134e4a 100%);
  border-radius: 20px;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(15,118,110,.35);
}
.fg-hero::before {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.fg-hero-ic {
  width: 52px; height: 52px; border-radius: 15px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; position: relative; z-index: 1;
}
.fg-hero-ic svg { width: 24px; height: 24px; }
.fg-hero-tx { position: relative; z-index: 1; }
.fg-hero-tx h1 { margin: 0 0 6px; color: #fff; font-size: 1.25rem; font-weight: 800; }
.fg-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; font-weight: 700;
  padding: 3px 11px; border-radius: 20px;
}
.fg-hero-badge.on { background: rgba(74,222,128,.25); color: #bbf7d0; }
.fg-hero-badge.off { background: rgba(255,255,255,.15); color: rgba(255,255,255,.85); }
.fg-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  animation: pxPulse 1.6s infinite;
}
/* Stats */
.fg-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 16px;
}
@media (max-width: 768px) {
  .fg-stats { grid-template-columns: repeat(2, 1fr); }
}
.fg-stat {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
}
.fg-stat > div { display: flex; flex-direction: column; min-width: 0; }
.fg-stat strong { font-size: 1.3rem; font-weight: 800; line-height: 1.1; }
.fg-stat small { font-size: .72rem; color: var(--muted); font-weight: 600; }
.fg-stat-ic {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fg-stat-ic svg { width: 20px; height: 20px; }
.st-amber .fg-stat-ic { background: #fef3c7; color: #d97706; }
.st-red .fg-stat-ic { background: #fee2e2; color: #dc2626; }
.st-slate .fg-stat-ic { background: #f1f5f9; color: #475569; }
.st-green .fg-stat-ic { background: #dcfce7; color: #16a34a; }
/* Toggle cards */
.fg-toggles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin-bottom: 8px;
}
@media (max-width: 640px) {
  .fg-toggles { grid-template-columns: 1fr; }
}
.fg-toggle-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: #f9fafb;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  cursor: pointer;
}
.fg-toggle-card input { display: none; }
.fg-toggle-track {
  width: 46px; height: 26px; border-radius: 20px;
  background: #d1d5db; position: relative;
  transition: background .2s; flex-shrink: 0;
}
.fg-toggle-track.sm { width: 40px; height: 22px; }
.fg-toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.fg-toggle-track.sm .fg-toggle-thumb { width: 16px; height: 16px; top: 3px; }
.fg-toggle-card input:checked + .fg-toggle-track { background: #059669; }
.fg-toggle-card input:checked + .fg-toggle-track .fg-toggle-thumb { left: 23px; }
.fg-toggle-card input:checked + .fg-toggle-track.sm .fg-toggle-thumb { left: 21px; }
.fg-toggle-tx { display: flex; flex-direction: column; min-width: 0; }
.fg-toggle-tx strong { font-size: .88rem; }
.fg-toggle-tx small { font-size: .74rem; color: var(--muted); }
/* Rule cards */
.fg-rules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin: 12px 0 4px;
}
@media (max-width: 640px) {
  .fg-rules { grid-template-columns: 1fr; }
}
.fg-rule-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 12px;
  cursor: pointer;
}
.fg-rule-card input { display: none; }
.fg-rule-card input:checked + .fg-toggle-track { background: #059669; }
.fg-rule-card input:checked + .fg-toggle-track .fg-toggle-thumb { left: 21px; }

/* ===== Device Block layout fix ===== */
.db-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}
.db-stats .fg-stat {
  min-width: 0 !important;
  padding: 12px 10px !important;
  gap: 10px !important;
  overflow: hidden !important;
}
.db-stats .fg-stat > div {
  min-width: 0 !important;
  overflow: hidden !important;
}
.db-stats .fg-stat small {
  white-space: normal !important;
  line-height: 1.3 !important;
}
@media (max-width: 640px) {
  .db-stats .fg-stat {
    flex-direction: column !important;
    text-align: center !important;
    padding: 12px 6px !important;
    gap: 6px !important;
  }
  .db-stats .fg-stat-ic {
    width: 36px !important; height: 36px !important;
  }
  .db-stats .fg-stat strong {
    font-size: 1.15rem !important;
  }
  .db-stats .fg-stat small {
    font-size: .68rem !important;
  }
}
/* Tables: clean horizontal scroll, no overlap */
.db-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 340px;
  -webkit-overflow-scrolling: touch;
}
.db-table {
  min-width: 640px;
  border-collapse: collapse;
}
.db-table th,
.db-table td {
  white-space: nowrap;
  padding: 10px 12px;
}

/* ===== Phone Rules dynamic ===== */
.ph-count {
  margin-left: auto;
  font-size: .76rem; font-weight: 700;
  background: #dcfce7; color: #15803d;
  padding: 4px 11px; border-radius: 20px;
  white-space: nowrap;
}
.ph-tools {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; align-items: center;
}
.ph-tools .input {
  flex: 1; min-width: 180px;
}
.ph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px; margin-top: 12px;
}
.ph-grid.dimmed {
  opacity: .45;
  pointer-events: none;
}
.ph-chip { cursor: pointer; }
.ph-chip input { display: none; }
.ph-chip-body {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px;
  background: #f9fafb;
  border: 1.5px solid rgba(0,0,0,.07);
  border-radius: 12px;
  transition: all .15s;
}
.ph-chip input:checked + .ph-chip-body {
  background: #ecfdf5;
  border-color: #059669;
  box-shadow: 0 0 0 1px #059669;
}
.ph-chip-code {
  font-size: .74rem; font-weight: 800;
  background: #e5e7eb; color: #374151;
  padding: 3px 7px; border-radius: 7px;
  white-space: nowrap;
}
.ph-chip input:checked + .ph-chip-body .ph-chip-code {
  background: #059669; color: #fff;
}
.ph-chip-name {
  font-size: .84rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== Incomplete Orders segmented control ===== */
.io-seg {
  display: inline-flex;
  gap: 4px;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 14px;
}
.io-seg a {
  padding: 8px 16px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}
.io-seg a.on {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.io-seg a b {
  background: #ecfdf5;
  color: #15803d;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: .76rem;
  margin-left: 4px;
}
.io-seg a.on b {
  background: #059669;
  color: #fff;
}

/* ===== Plugin page dynamic ===== */
.pl-steps {
  display: flex; align-items: center;
  gap: 8px; margin-bottom: 16px;
}
.pl-step {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 700; color: var(--muted);
}
.pl-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: #f3f4f6; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 800; flex-shrink: 0;
}
.pl-step.done { color: #15803d; }
.pl-step.done .pl-step-num { background: #059669; color: #fff; }
.pl-step.current { color: #111827; }
.pl-step.current .pl-step-num { background: #0f766e; color: #fff; }
.pl-step-line {
  flex: 1; height: 2px;
  background: #e5e7eb; border-radius: 2px;
  min-width: 12px;
}
.pl-card { margin-bottom: 14px; }
.pl-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.pl-card-head h3 { margin: 0; font-size: 1rem; }
.pl-num {
  width: 30px; height: 30px; border-radius: 10px;
  background: #ccfbf1; color: #0f766e;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0;
}
.pl-code-box {
  display: flex; align-items: center; gap: 10px;
  background: #f9fafb;
  border: 1.5px dashed #0f766e;
  border-radius: 14px;
  padding: 14px 16px;
  flex-wrap: wrap;
}
.pl-code {
  font-family: monospace;
  font-size: 1.25rem; font-weight: 800; letter-spacing: 1px;
  color: #111827;
  word-break: break-all;
}
.pl-feats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 12px;
}
@media (max-width: 640px) {
  .pl-feats { grid-template-columns: 1fr; }
}
.pl-feat {
  display: flex; gap: 10px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 12px;
}
.pl-feat > div { display: flex; flex-direction: column; min-width: 0; }
.pl-feat strong { font-size: .86rem; }
.pl-feat small { font-size: .76rem; color: var(--muted); line-height: 1.4; }
.pl-feat-ic {
  width: 36px; height: 36px; border-radius: 10px;
  background: #ccfbf1; color: #0f766e;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pl-feat-ic svg { width: 18px; height: 18px; }

/* ===== Connected stores list hero ===== */
.woo-list-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  margin: -4px -4px 14px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 45%, #134e4a 100%);
  border-radius: 16px;
  position: relative; overflow: hidden;
  box-shadow: 0 6px 18px rgba(15,118,110,.3);
}
.woo-list-hero::before {
  content: '';
  position: absolute; right: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.woo-list-hero-ic {
  width: 50px; height: 50px; border-radius: 14px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; position: relative; z-index: 1;
}
.woo-list-hero-ic svg { width: 24px; height: 24px; }
.woo-list-hero-tx { position: relative; z-index: 1; }
.woo-list-hero-tx h3 {
  margin: 0 0 6px; color: #fff;
  font-size: 1.1rem; font-weight: 800;
}
.woo-list-hero-badge {
  font-size: .76rem; font-weight: 700;
  background: rgba(255,255,255,.18);
  color: #fff; padding: 3px 11px; border-radius: 20px;
}
.woo-list-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; margin-bottom: 18px;
}
@media (max-width: 640px) {
  .woo-list-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.woo-list-stat {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 13px 6px 11px;
  background: #f9fafb;
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 14px;
  min-width: 0;
}
.woo-list-stat strong {
  font-size: 1.2rem; font-weight: 800; white-space: nowrap;
}
.woo-list-stat small {
  font-size: .7rem; color: var(--muted); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ===== Connect form dynamic ===== */
.woo-connect-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 45%, #134e4a 100%);
  border-radius: 14px;
  position: relative; overflow: hidden;
}
.woo-connect-hero::before {
  content: '';
  position: absolute; right: -25px; top: -25px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.woo-connect-hero-ic {
  width: 46px; height: 46px; border-radius: 13px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; position: relative; z-index: 1;
}
.woo-connect-hero-ic svg { width: 22px; height: 22px; }
.woo-connect-hero h3 {
  margin: 0 0 3px; color: #fff;
  font-size: 1.02rem; font-weight: 800; position: relative; z-index: 1;
}
.woo-connect-hero span {
  font-size: .76rem; color: rgba(255,255,255,.85);
  position: relative; z-index: 1;
}
.woo-connect-steps {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
  font-size: .78rem; font-weight: 700; color: var(--muted);
}
.woo-cstep {
  display: flex; align-items: center; gap: 5px;
}
.woo-cstep b {
  width: 22px; height: 22px; border-radius: 50%;
  background: #ccfbf1; color: #0f766e;
  display: flex; align-items: center; justify-content: center;
  font-size: .74rem;
}
.woo-cstep-line {
  flex: 1; height: 2px; background: #e5e7eb; border-radius: 2px;
  min-width: 10px;
}
.woo-valid {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: #dcfce7; color: #16a34a;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800;
}
.woo-input-wrap:has(.woo-eye) .woo-valid {
  right: 44px;
}
.woo-input-wrap {
  position: relative;
}
.woo-help {
  margin-top: 14px;
  background: #f9fafb;
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 12px;
  padding: 12px 14px;
}
.woo-help summary {
  font-size: .86rem; font-weight: 700; cursor: pointer;
}
.woo-help ol {
  margin: 10px 0 0; padding-left: 20px;
  font-size: .84rem; color: var(--muted);
  display: flex; flex-direction: column; gap: 6px;
}
.woo-connect-btn:disabled {
  opacity: .7;
}

/* ===== Pixel dashboard: filter bar + store cards ===== */
.px-filter-bar {
  display: flex; align-items: flex-end; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.px-filter-ic {
  width: 40px; height: 40px; border-radius: 12px;
  background: #ccfbf1; color: #0f766e;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px; flex-shrink: 0;
}
.px-filter-ic svg { width: 20px; height: 20px; }
.px-filter-bar .field { flex: 1; min-width: 160px; margin: 0; }
.px-store-card.dyn {
  padding: 18px;
  border-radius: 18px;
}
.px-store-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.px-store-logo {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff; font-weight: 800; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.px-store-head-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.px-store-head-tx strong {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.px-store-head-tx small { color: var(--muted); font-size: .76rem; }
.px-platform-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 12px;
}
@media (max-width: 560px) {
  .px-platform-grid { grid-template-columns: 1fr; }
}
.px-platform-card {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.05);
}
.px-platform-card.pl-meta { background: #eff6ff; }
.px-platform-card.pl-tiktok { background: #f5f3ff; }
.px-platform-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.px-platform-toggles {
  display: flex; gap: 14px;
  font-size: .78rem; color: var(--muted); font-weight: 600;
}
.px-platform-toggles span {
  display: inline-flex; align-items: center; gap: 5px;
}
.px-platform-toggles i {
  width: 8px; height: 8px; border-radius: 50%;
  background: #d1d5db;
}
.px-platform-toggles span.on { color: #15803d; }
.px-platform-toggles span.on i { background: #22c55e; }
.px-health-strip {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 13px; border-radius: 12px;
  font-size: .82rem; margin-bottom: 10px;
}
.px-health-strip.bad { background: #fef2f2; border: 1px solid #fecaca; }
.px-health-strip.warn { background: #fffbeb; border: 1px solid #fde68a; }
.px-health-strip span { color: var(--muted); }
.px-domain-check {
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,.05);
  margin-bottom: 12px;
}
.px-setup-card.dyn { padding: 0; overflow: hidden; border-radius: 18px; }
.px-setup-card.dyn .px-setup-form,
.px-setup-card.dyn .px-card-actions,
.px-setup-card.dyn .px-verify-err { padding-left: 18px; padding-right: 18px; }
.px-setup-card.dyn .px-setup-form { padding-top: 16px; }
.px-setup-card.dyn .px-card-actions { padding-bottom: 16px; }
.px-setup-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; position: relative; overflow: hidden;
}
.px-setup-hero::before {
  content: '';
  position: absolute; right: -25px; top: -25px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.px-setup-hero.hero-meta { background: linear-gradient(135deg, #1877f2, #0d5cb6); }
.px-setup-hero.hero-tiktok { background: linear-gradient(135deg, #1f2937, #000); }
.px-setup-hero-ic {
  width: 46px; height: 46px; border-radius: 13px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; position: relative; z-index: 1;
}
.px-setup-hero-ic svg { width: 22px; height: 22px; }
.px-setup-hero-tx { flex: 1; min-width: 0; position: relative; z-index: 1; }
.px-setup-hero-tx h3 { margin: 0 0 6px; color: #fff; font-size: 1.02rem; font-weight: 800; }
.px-setup-status .pill { background: rgba(255,255,255,.9); }
.px-verify-err {
  margin: 12px 0 0; padding-top: 0;
  font-size: .82rem; color: #dc2626;
}
.px-setup-card.dyn .px-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.px-setup-card.dyn .px-check {
  background: #f9fafb; border: 1px solid rgba(0,0,0,.07);
  border-radius: 20px; padding: 7px 12px;
  font-size: .84rem; font-weight: 600;
}
.px-setup-card.dyn .px-check:has(input:checked) {
  background: #ccfbf1; border-color: #5eead4; color: #0f766e;
}

/* ===== Pixel setup switch ===== */
.px-switch {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 8px; cursor: pointer; font-weight: 700;
  position: relative;
}
.px-switch input[type="checkbox"] {
  position: absolute; top: 0; left: 0;
  width: 20px; height: 20px; margin: 0;
  opacity: 0; pointer-events: none;
}
/* Hidden inputs must never render, even inside .field labels */
.field input[type="hidden"] { display: none; }
.px-switch-track {
  width: 48px; height: 26px; border-radius: 20px;
  background: #d1d5db; position: relative;
  transition: background .2s; flex-shrink: 0;
}
.px-switch-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: left .2s;
}
.px-switch input[type="checkbox"]:checked + .px-switch-track {
  background: #0d9488;
}
.px-switch input[type="checkbox"]:checked + .px-switch-track .px-switch-thumb {
  left: 25px;
}

/* ===== Integration switch row: label left, compact switch right ===== */
.px-integration-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #f9fafb; border: 1px solid rgba(0,0,0,.05);
  border-radius: 12px; padding: 12px 14px;
}
.px-integration-row .px-switch { margin-top: 0; }
.px-integration-row .px-switch-track {
  width: 40px; height: 22px;
}
.px-integration-row .px-switch-thumb {
  width: 16px; height: 16px; top: 3px; left: 3px;
}
.px-integration-row .px-switch input[type="checkbox"]:checked + .px-switch-track .px-switch-thumb {
  left: 21px;
}

/* ===== [hidden] must beat .btn / .px-live display rules ===== */
[hidden] { display: none !important; }

/* ===== Pixel setup card actions: tidy grid ===== */
.px-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: dense;
  gap: 8px;
}
.px-card-actions form { display: contents; }
.px-card-actions .btn { width: 100%; }
.px-card-actions [data-px-btn-off],
.px-card-actions [data-px-btn-on] { grid-column: 1 / -1; }

/* ===== Event Manager dynamic ===== */
.io-seg a { display: inline-flex; align-items: center; gap: 6px; }
.io-seg a svg { width: 16px; height: 16px; }
.ev-filter { margin-bottom: 16px; }
.ev-summary { margin-bottom: 16px; }
.ev-summary h4,
.ev-dups h4 {
  margin: 0 0 12px;
  display: flex; align-items: center; gap: 7px;
  font-size: 1rem;
}
.ev-summary h4 svg,
.ev-dups h4 svg { width: 18px; height: 18px; }
.ev-stat-grid {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.ev-stat {
  flex: 1; min-width: 90px; text-align: center;
  padding: 13px 8px 11px;
  background: #f9fafb;
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 14px;
}
.ev-stat strong {
  display: block; font-size: 1.4rem; font-weight: 800;
  white-space: nowrap;
}
.ev-stat small { font-size: .74rem; color: var(--muted); font-weight: 600; }
.ev-stat.ok strong { color: #16a34a; }
.ev-stat.info strong { color: #2563eb; }
.ev-stat.bad strong { color: #dc2626; }
.ev-stat.muted strong { color: var(--muted); }
.ev-recon {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--line, #e3eae8);
}
.ev-recon-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch;
}
.ev-recon-row .ev-stat { flex: 1; min-width: 120px; }
.ev-recon-mark {
  display: flex; align-items: center; justify-content: center;
  width: 38px; flex-shrink: 0;
}
.ev-recon-mark svg { width: 26px; height: 26px; }
.ev-recon-mark.ok { color: #16a34a; }
.ev-recon-mark.bad { color: #dc2626; }
.ev-recon-msg {
  margin: 12px 0 0;
  display: flex; align-items: center; gap: 6px;
  font-size: .86rem; font-weight: 600;
}
.ev-recon-msg svg { width: 16px; height: 16px; flex-shrink: 0; }
.ev-recon-msg.ok { color: #16a34a; }
.ev-recon-msg.bad { color: #dc2626; }
.ev-dups {
  margin-bottom: 16px;
  border: 2px solid #fecaca;
}
.ev-dups h4 { color: #dc2626; }
.ev-dups p { margin: 0 0 12px; }
.ev-journey { margin-bottom: 12px; }
.ev-journey.dup { border: 2px solid #fecaca; }
.ev-journey.nopurchase { border: 2px solid #fde68a; }
.ev-journey-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.ev-journey-name {
  font-size: 16px;
  display: inline-flex; align-items: center; gap: 6px;
}
.ev-journey-name svg { width: 17px; height: 17px; }
.ev-journey-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-journey-pills .pill { display: inline-flex; align-items: center; gap: 4px; }
.px-ev-card.dyn { margin-bottom: 12px; }
.px-ev-card.dyn .px-ev-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-platform { font-weight: 700; }
.ev-platform.meta { color: #1877f2; }
.ev-platform.tiktok { color: #111827; }
.ev-error { color: #c0392b; display: flex; align-items: center; gap: 5px; }
.ev-error svg { width: 15px; height: 15px; flex-shrink: 0; }
.px-ev-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.px-ev-actions .btn svg { width: 15px; height: 15px; }

/* ===== Event detail dynamic ===== */
.px-ev-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; margin-bottom: 16px;
  border-radius: 18px; position: relative; overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.px-ev-hero::before {
  content: '';
  position: absolute; right: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.px-ev-hero.hero-meta { background: linear-gradient(135deg, #1877f2, #0d5cb6); }
.px-ev-hero.hero-tiktok { background: linear-gradient(135deg, #1f2937, #000); }
.px-ev-hero-ic {
  width: 50px; height: 50px; border-radius: 14px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; position: relative; z-index: 1;
}
.px-ev-hero-ic svg { width: 24px; height: 24px; }
.px-ev-hero-tx { flex: 1; min-width: 0; position: relative; z-index: 1; }
.px-ev-hero-tx h1 {
  margin: 0 0 4px; color: #fff;
  font-size: 1.15rem; font-weight: 800;
  word-break: break-word;
}
.px-ev-hero-tx span { font-size: .8rem; color: rgba(255,255,255,.85); word-break: break-all; }
.px-ev-hero-pills {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
  flex-shrink: 0; position: relative; z-index: 1;
}
.px-ev-hero-pills .pill { background: rgba(255,255,255,.92); }
.ev-copy-btn {
  border: none; background: #f3f4f6; border-radius: 8px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; vertical-align: middle; color: var(--muted);
}
.ev-copy-btn svg { width: 15px; height: 15px; }
.ev-payload-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.ev-payload-head h3 { margin: 0; }

/* ===== Extra store slots buy card (/woocommerce) ===== */
.ex-buy-card { border: 2px solid #0d9488; }
.ex-buy-hero { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.ex-buy-hero-ic {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.ex-buy-hero-ic svg { width: 22px; height: 22px; }
.ex-buy-hero h3 { margin: 0 0 2px; font-size: 1.05rem; }
.ex-buy-hero span { font-size: .82rem; color: var(--muted); }
.ex-buy-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.ex-buy-row .field { flex: 1; min-width: 180px; margin: 0; }
.ex-buy-row .field input { max-width: 140px; }
.ex-total { font-size: 1rem; }
.ex-total strong { font-size: 1.35rem; color: #0f766e; margin-left: 4px; }
.ex-total small { display: block; font-size: .75rem; color: var(--muted); }
.ex-manual { margin-top: 12px; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.ex-manual summary { cursor: pointer; font-weight: 600; color: #0f766e; }
.ex-manual-form { display: grid; gap: 10px; margin-top: 10px; }
@media (min-width: 640px) {
  .ex-manual-form { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; }
  .ex-manual-form .field { margin: 0; }
}

/* ===== Landing page dynamics (public/js/landing.js) ===== */
html { scroll-behavior: smooth; }
.landing-nav { transition: box-shadow .2s; }
.landing-nav.scrolled { box-shadow: 0 2px 12px rgba(0, 0, 0, .08); }
.lp-stepper {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px; margin: 0 0 6px;
}
.lp-stepper-label { font-size: .85rem; font-weight: 600; margin-right: auto; }
.lp-stepper button {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--brand); background: #fff; color: var(--brand-dark);
  font-size: 1.15rem; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lp-stepper button:hover:not(:disabled) { background: var(--brand-soft); }
.lp-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.lp-stepper b { min-width: 22px; text-align: center; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.lp-note { font-size: .78rem; color: var(--muted); margin: 0 0 12px; }
.faq-item summary .ic { transition: transform .2s; }
.faq-item[open] summary .ic { transform: rotate(180deg); }
.mock-chat .mock-msg { transition: opacity .3s; }
.mock-chat.fading .mock-msg { opacity: 0; }

/* ===== Landing: feature groups (rendered from lib/features.js) ===== */
.feat-group-title { font-size: 1.05rem; margin: 22px 0 12px; color: var(--brand-dark); }
.feat-group-title:first-of-type { margin-top: 6px; }

/* ===== Plan-expiry warning popup (dashboard) ===== */
.ew-foot { flex-wrap: wrap; }

/* ===== Desktop/mobile split — fix 2026-11-05 =====
 * The bubble .bottomnav rule (~3820) re-sets display:flex AFTER the
 * min-width:900px hide rule (~950), so the mobile bottom nav leaked onto
 * desktop (same specificity, later rule wins). The global body padding
 * (~3907) also left a 64px dead gap at the bottom on desktop.
 * Re-asserted here, last in the file, so desktop gets the sidebar
 * layout and mobile keeps the bottom nav. */
@media (min-width: 900px) {
  .bottomnav { display: none !important; }
  .topbar { display: none !important; }
  body { padding-bottom: 0; }
}

/* ===== Desktop audit fixes — 2026-11-05 =====
 * A1: orders desktop rules (~1820) lost to a later plain block (~2301):
 * sticky filter bar + capped internal table scroll on desktop. Re-asserted.
 * B4 (bigger than first thought): .order-filter-groups was INVISIBLE on
 * desktop — plain rule ~3671 sets max-height:0 + opacity:0, and both toggle
 * buttons are hidden >=768px, so the groups could never expand.
 * Re-asserted visible + horizontal on desktop.
 * A2: .woo-store-sync padding-top 14px beat the >=769px 4px rule.
 * B1/B3/B7: grids that overflow on laptops — fewer columns until wide screens.
 * B5: products .pd-scroll capped at 600px like orders was.
 * B6/B8/B11: 2-col grids for setup cards, card lists, More page (wide screens).
 * B9: inbox bubbles capped at 640px. B10: channel secret inputs 220px. */
.msg { max-width: min(82%, 640px); }
.ch-cred-input { width: 110px; }
@media (min-width: 900px) {
  .order-sticky-head { position: static; }
  .order-scroll { max-height: none; min-height: 0; overflow: visible; }
  .order-scroll thead th { position: static; }
  .order-filter-groups { flex-direction: row; max-height: none; opacity: 1; overflow: visible; }
  .order-filter-group { flex: 1; min-width: 0; }
  .pd-scroll { max-height: none; min-height: 0; overflow: visible; }
  .ch-cred-input { width: 220px; }
}
@media (min-width: 1280px) {
  .pricing-grid { grid-template-columns: repeat(4, 1fr); }
  .px-stats { grid-template-columns: repeat(5, 1fr); }
  .tpl-list, .bc-list, .px-ev-list, .px-stores { display: grid; grid-template-columns: 1fr 1fr; }
  .woo-store-list { display: grid; grid-template-columns: 1fr 1fr; }
  .px-setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .px-setup-grid .px-setup-card { margin-bottom: 0; }
  .page-narrow > div.app-list { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1600px) {
  .dash-stats.stat-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ===== Billing design fixes (PC) — 2026-11-05 =====
 * Hero was violet while the dashboard hero + brand are teal — matched.
 * Page capped at 1200px (like .woo-page) so cards don't stretch across
 * wide desktops; payment steps + manual form sit side by side >=1100px. */
.billing-wrap { max-width: 1200px; margin: 0 auto; }
.billing-pay-grid { display: grid; gap: 16px; }
@media (min-width: 1100px) {
  .billing-pay-grid { grid-template-columns: 1fr 1.4fr; align-items: start; }
  .billing-pay-grid > :only-child { grid-column: 1 / -1; }
}

/* ===== Dashboard design fixes (PC) — 2026-11-05 =====
 * Recent conversations were trapped in a 360px internal scroll box on
 * desktop (same class as the orders/products fix) — natural page scroll
 * now; rows go 2-col on wide screens. The WooCommerce summary grid has
 * exactly 4 cards, so it gets 4 columns at >=1600px instead of leaving
 * 2 empty columns in the 6-col grid. */
@media (min-width: 900px) {
  .recent-scroll { max-height: none; overflow: visible; padding-right: 0; }
}
@media (min-width: 1280px) {
  .recent-list { display: grid; grid-template-columns: 1fr 1fr; }
}
/* ===== Dashboard card layout — auto-fit stat grids (PC) — 2026-11-05 =====
 * Fixed 3-col / 6-col grids left dead space whenever the card count did not
 * match the column count (4 cards in a 6-col grid = 2 empty columns;
 * 4 cards in a 3-col grid = a lonely 4th card on row 2). auto-fit lets the
 * grid fit as many equal columns as the width allows and collapses empty
 * tracks, so 2, 3, 4, 5 or 6 cards always fill the full width evenly.
 * 200px floor: a card's min-content is ~180px (48px tile + 13px gap + 32px
 * padding + ~85px number), so 200px never squeezes it, yet 4 columns fit
 * from ~1150px viewports up (4x200 + 3x14 gap = 842px of content width).
 * This beats the earlier 900px (3-col) and 1600px (6-col) rules (same
 * specificity, later in file). NOTE: do NOT add a .woo-stats class to a
 * dashboard grid — that name already exists in this file (line ~2832:
 * display:flex, and a mobile !important 3-col grid), and it silently
 * turns the grid into flex / 3-col. The Woo grid stays a plain
 * .stat-grid.dash-stats so this rule governs it. */
@media (min-width: 900px) {
  .dash-stats.stat-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* ===== Dashboard chart pair side by side on PC — 2026-11-05 =====
 * The 7-day orders chart and the 6-month revenue chart stacked full-width.
 * Wrapped in .dash-charts: 2 columns on PC (>=900px), stacked below that.
 * auto-fit keeps a lone chart full-width when only one of the two renders;
 * the outer EJS condition hides the wrapper entirely when neither renders. */
.dash-charts { display: grid; gap: 14px; margin-bottom: 16px; }
.dash-charts > .card { margin-bottom: 0; }
@media (min-width: 900px) {
  .dash-charts { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
}

/* ===== Responsive auto-fit system — 2026-11-06 =====
 * Audit found these breakages; each rule is scoped to the width where it
 * breaks. Desktop (>=900px) untouched.
 * 1. Categories top bar: 3 nowrap buttons shared one row; "নতুন ক্যাটাগরি"
 *    spilled ~30px on phones <440px. Primary takes its own row <=640px.
 * 2. Dashboard store rows: .woo-store-stats was nowrap; on busy days the
 *    two spans spilled ~45px past the card at 320px. Spans now wrap.
 * 3. Fraud Guard stats: plain 1fr tracks overflowed ~8px at 320px.
 *    Same minmax(0,1fr) + overflow:hidden pattern .db-stats already uses.
 * 4. Extra-store manual form: 1fr tracks + size=20 inputs overflowed
 *    ~10-15px at 640-660px. Tracks now minmax(0,1fr), fields min-width:0.
 * 5. Stat cards at 320px had ~1px margin (iPhone Bengali font could tip
 *    them over): slightly smaller tile + gap below 431px.
 * 6. Modal foot buttons squeezed at 320px: allow wrap.
 * 7. Chart month labels ("সেপ্টেম্বর") overlapped neighbours at 320px:
 *    ellipsize instead. */
@media (max-width: 640px) {
  .cat-topbar .page-head-actions { flex-wrap: wrap; }
  .cat-topbar .page-head-actions .btn-primary { flex: 1 1 100%; }
}
.woo-store-stats { flex-wrap: wrap; }
@media (max-width: 768px) {
  .fg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fg-stat { min-width: 0; overflow: hidden; }
}
@media (min-width: 640px) {
  .ex-manual-form { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
  .ex-manual-form .field { min-width: 0; }
}
@media (max-width: 430px) {
  .dash-stats .stat-prem { gap: 8px; }
  .dash-stats .stat-prem .tile { width: 36px; height: 36px; }
}
.modal-foot { flex-wrap: wrap; }
.dash-bars .dlab { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ---- Tenant notifications (scoped .tn-*, 2026-11-14) ---- */
/* Topbar bell (mobile only — the topbar itself hides at >=900px,
   mirroring the profile dropdown's positioning). */
.tn-bell-wrap { position: relative; }
.tn-bell-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft); cursor: pointer; padding: 0;
}
.tn-bell-btn .ic { width: 20px; height: 20px; display: block; }
.tn-bell-btn:hover { background: var(--bg-soft); color: var(--ink); }
.tn-bell-count {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.tn-bell-drop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: min(340px, calc(100vw - 32px));
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden;
  max-height: min(70vh, 480px); overflow-y: auto;
}
.tn-bell-head { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); font-weight: 700; font-size: .92rem; }
.tn-bell-item {
  display: block; padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: .88rem; color: var(--ink); text-decoration: none;
}
.tn-bell-item:last-child { border-bottom: 0; }
a.tn-bell-item:hover { background: var(--bg-soft); text-decoration: none; }
.tn-bell-item.tn-unread { background: var(--bg-soft); }
.tn-bell-item.tn-unread .tn-bell-title { font-weight: 700; }
.tn-bell-title { display: block; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.tn-bell-time { display: block; margin-top: 2px; }
.tn-bell-foot { padding: 10px 14px; border-top: 1px solid var(--line-soft); text-align: center; }
.tn-bell-foot a { font-size: .88rem; font-weight: 600; color: var(--brand-dark); }
.tn-bell-foot a:hover { text-decoration: underline; }

/* Sidebar badge: right-aligned in the flex navlink; in collapsed
   mode it pins to the icon's corner (tn-navlink only — no shared
   selector is touched). */
.tn-side-badge { margin-left: auto; }
@media (min-width: 900px) {
  body.sidebar-collapsed .tn-navlink { position: relative; }
  body.sidebar-collapsed .tn-side-badge { position: absolute; top: 2px; right: 6px; margin-left: 0; }
}

/* Tenant list page. */
.tn-readall { margin-bottom: 14px; }
.tn-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.tn-filters select { min-width: 0; }
.tn-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.tn-item { padding: 14px 16px; min-width: 0; }
.tn-item.tn-unread { border-left: 3px solid var(--brand); }
.tn-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tn-item-title { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
a.tn-item-title { color: var(--brand-dark); }
a.tn-item-title:hover { text-decoration: underline; }
.tn-item.tn-unread .tn-item-title { font-weight: 700; }
.tn-item-body { margin: 6px 0 0; font-size: .9rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.tn-item-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tn-item-foot form { margin: 0; }
.tn-note { margin-top: 12px; text-align: center; }

/* ---- Uploaded brand lockup (dynamic brand, 2026-11-15) ---- */
/* The wide platform logo image replaces the mark + text inside .brand
   containers (login, register, landing header/footer, legal pages,
   admin auth). Height-capped so the ~2.77:1 lockup never stretches the
   header/auth layout; width auto + contain keeps its aspect. This rule
   targets ONLY brand-lockup images — no other styles are touched. */
.brand-lockup { height: 36px; width: auto; max-width: 200px; object-fit: contain; display: block; flex: 0 0 auto; }

/* ---- Landing header, mobile (2026-11-15) ---- */
/* Below 900px the links nav is hidden, so space-between stranded the
   login/signup buttons in the middle of the header. margin-left:auto
   pulls the CTA group right, next to the hamburger. Desktop
   untouched (links visible there). Appended, nothing earlier edited. */
@media (max-width: 899px) {
  .landing-cta { margin-left: auto; }
}

/* ---- Payment method chooser (2026-11-16) ---- */
/* Tenant pay-pick modal options (public/js/app.js chooser). Fresh
   paypick-* prefix — no existing rule touched, no class reused. The
   modal shell itself reuses .modal-backdrop/.modal. Options stack
   full-width so nothing overflows on narrow phones; desktop keeps the
   440px modal. Appended, nothing earlier edited. */
.paypick-opt { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 12px 14px; margin: 0 0 10px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font: inherit; color: inherit; appearance: none; -webkit-appearance: none; }
.paypick-opt:last-child { margin-bottom: 0; }
.paypick-opt:hover { border-color: var(--brand); background: var(--brand-soft); }
.paypick-opt:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.paypick-opt:disabled { opacity: .6; cursor: default; }
.paypick-opt-title { font-weight: 700; font-size: 1rem; color: var(--ink); }
.paypick-opt-sub { font-size: .85rem; line-height: 1.45; color: var(--ink-soft); }

/* ---- Per-store renewal checkout + term countdown (Phase 4, 2026-11-17) ---- */
.rnw-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.rnw-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); cursor: pointer; }
.rnw-row input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); cursor: pointer; }
.rnw-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rnw-row-url { font-weight: 700; overflow-wrap: anywhere; }
.rnw-row-meta { font-size: .85rem; color: var(--muted); }
.rnw-row-price { font-weight: 700; white-space: nowrap; }
.rnw-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.rnw-total { font-size: 1.05rem; }
.rnw-manual-summary { border: 1px dashed var(--brand-line); border-radius: var(--r-sm); background: var(--brand-soft); padding: 10px 12px; margin: 12px 0 0; }
.rnw-manual-summary p { margin: 2px 0; }
.rnw-term-row .woo-ref-sync-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rnw-renew-link { font-size: .85rem; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.rnw-warn-list { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 520px) {
  .rnw-foot .btn { width: 100%; }
}

/* Fix 2026-11-17 (ex-buy hero icon invisible): `.ex-buy-hero span`
   (specificity 0,1,1, later in file) beat `.ex-buy-hero-ic` (0,1,0),
   so the plus icon rendered in --muted (#5f6b66) on the dark teal
   tile. Higher-specificity restore — white icon only; the subtitle
   span keeps --muted. */
.ex-buy-hero span.ex-buy-hero-ic { color: #fff; }

/* Manual-payment popup (2026-11-17): JS moves the server-rendered
   manual form into the shared .modal — these rules only let the tall
   form scroll inside the modal, strip the card chrome of the moved
   node (the modal head carries the title), and collapse the billing
   pay grid to one column once its manual section is hidden. */
.mp-modal .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mp-modal .modal-body > .card { border: 0; box-shadow: none; padding: 0; margin: 0; background: transparent; }
.mp-modal .modal-body > .card > .card-head { display: none; }
.mp-modal .modal-body > details { margin: 0; border: 0; padding: 0; }
.mp-modal .modal-body > details > summary { display: none; }
.billing-pay-grid.mp-pay-grid-one { grid-template-columns: 1fr; }
@media (max-width: 640px) {
  .mp-modal .modal-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .mp-modal .modal-foot .btn { min-height: 44px; }
}

/* Number copy buttons (2026-11-17): tappable copy affordance next to
   manual-payment numbers in the billing + WooCommerce lists. 36px tap
   target for phones; inline-flex so it sits in flex rows and in the
   WooCommerce paragraph flow without overflow. */
.mp-copy-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--brand-dark); cursor: pointer; vertical-align: middle; flex-shrink: 0; }
.mp-copy-btn:hover, .mp-copy-btn:focus-visible { background: var(--brand-soft); border-color: var(--brand); }
.mp-copy-btn .ic { width: 18px; height: 18px; }

/* Billing hero redesign (2026-11-17): the hero card looked half-empty
   for tenants without the AI feature (no AI stat, no quota bar), and
   the stats row floated in the green space. The stats now sit in one
   translucent strip that reads as a composed block with a single stat
   or two; the strip's tighter top margin removes the empty gap. The
   green gradient, data, and text are unchanged. */
.bh-stats { display: flex; flex-wrap: wrap; gap: 12px 20px; margin: 16px 0 0; padding: 12px 14px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; }
.bh-stats .bh-stat { flex: 1 1 120px; min-width: 0; }
.bh-stats .bh-stat:only-child { flex: 1 1 100%; }
.bh-bar { margin-top: 14px; }

/* ===== Tenant sidebar design refresh (2026-11-17) =====
 * Desktop-only visual refresh of the tenant sidebar: a clearer
 * active pill with a brand accent, hover feedback, stronger
 * section-label hierarchy, consistent row rhythm, and a tidier
 * bottom user card. Visual only — no markup, link, gating, or
 * collapse behaviour changes. Every rule lives inside the desktop
 * breakpoint so the mobile topbar + bottomnav are untouched, and
 * every selector stays below the body.sidebar-collapsed overrides
 * so the collapsed icon rail keeps winning. The .nav-profile rule
 * is .sidebar-qualified to beat the same-named rule in the inline
 * <style> block of views/partials/nav.ejs (later in document order,
 * pinned byte-exact by tests/sidebar_bottom_pin.test.js).
 * Indentation is deliberate: tests/notifications.test.js forbids
 * lines starting with `.sidebar ` in appended style.css blocks. */
@media (min-width: 900px) {
  .sidebar .sidebar-head { margin: 0 6px 12px; gap: 8px; }
  .sidebar .sidebar-toggle { width: 40px; height: 40px; border-radius: 10px; }
  .sidebar .sidebar-toggle:hover { background: var(--bg-softer); }
  .sidebar .nav-label { padding: 16px 12px 6px; letter-spacing: .08em; }
  .sidebar a.navlink { min-height: 42px; padding: 10px 12px; gap: 12px; border-radius: 10px; transition: background-color .15s ease, color .15s ease; }
  .sidebar a.navlink .ic { width: 20px; height: 20px; }
  .sidebar a.navlink:hover { background: var(--bg-softer); color: var(--ink); }
  .sidebar a.navlink:hover .ic { color: var(--brand-dark); }
  .sidebar a.navlink.on { box-shadow: inset 3px 0 0 var(--brand); }
  .sidebar .nav-profile { padding: 14px 10px 6px; gap: 12px; border-top: 1px solid var(--line); }
  .sidebar .nav-logout { margin-top: 8px; padding: 0; }
  .sidebar .nav-logout button { min-height: 42px; padding: 10px 12px; gap: 12px; border-radius: 10px; }
}

/* CSP-04 (2026-11-17): filter-chip remove links — same × styling as the
   old onclick buttons they replace. */
.active-chip a {
  background: none; border: none; cursor: pointer;
  font-size: .8rem; line-height: 1; padding: 0;
  color: inherit; opacity: .7; text-decoration: none;
}
.active-chip a:hover { opacity: 1; }

/* TC-06 (2026-11-17): desktop inbox customer panel — the slide-over
   rules at :545-551 sit at BASE level (outside any @media) and the
   :535 display:none (0,3,0) beats the :532 display:block, so the panel
   was unreachable on desktop in both bands. These overrides restore
   the intended behavior without touching the original rules:
   - 900-1279px: slide-over — display:block so .open can slide it in.
   - >=1280px: static third grid column — undo the off-canvas
     fixed positioning; the toggle is hidden (panel always visible).
   Mobile (<900px) is untouched: base display:none still wins and the
   <details class="customer-mobile"> path stays the access route. */
@media (min-width: 900px) and (max-width: 1279px) {
  .inbox-grid.with-panel .customer-panel { display: block; }
  .inbox-grid.with-panel .customer-panel.open { display: block; }
}
@media (min-width: 1280px) {
  .inbox-grid.with-panel .customer-panel {
    position: static;
    transform: none;
    width: auto;
    box-shadow: none;
  }
  #custPanelToggle { display: none; }
}

/* PG-03 (2026-11-17): "আরও পুরনো দেখুন" button above the thread bubbles. */
.load-older-wrap { display: flex; justify-content: center; padding: 8px 0 4px; }

/* DS-05 (2026-11-17): WooCommerce order-status pill tones — the chat
   statuses (draft/pending_confirm/confirmed/cancelled) already had tones;
   Woo statuses rendered neutral. Tones mirror .pill.ok/.warn/.bad/.info. */
.pill.st-pending { background: var(--amber-soft); border-color: #f0dcae; color: var(--amber); }
.pill.st-processing { background: var(--blue-soft); border-color: #bcd3f7; color: var(--blue); }
.pill.st-on-hold { background: var(--amber-soft); border-color: #f0dcae; color: var(--amber); }
.pill.st-completed { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.pill.st-refunded { background: var(--bg-soft); color: var(--muted); }
.pill.st-failed { background: var(--red-soft); border-color: #f3c2c2; color: var(--red); }

/* DS-04 (2026-11-17): page titles promoted from h3 to h1 keep their
   card/hero sizing — the base h1 size (1.55rem) would blow out these
   headers. Each rule mirrors the h3 rule it replaces. */
.auto-cta-left h1 { margin: 0 0 4px; font-size: 1.1rem; }
.bc-head-top h1 { margin: 0 0 4px; font-size: 1.02rem; }
.br-head-top h1 { margin: 0 0 4px; font-size: 1.02rem; }
.px-hero-tx h1 { margin: 0; color: #fff; font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }

/* DS-11 (2026-11-17): order-timeline step states. The markup carried
   done/bad classes with no rules at all, so every step looked identical.
   Done keeps the default brand icon tint; pending steps go muted; hold
   goes amber; terminal goes red. Layout untouched. */
.order-timeline li:not(.done):not(.bad):not(.hold) .icon-wrap { background: var(--bg-soft); color: var(--muted); border-color: var(--line); }
.order-timeline li.bad .icon-wrap { background: var(--red-soft); color: var(--red); border-color: #f3c2c2; }
.order-timeline li.hold .icon-wrap { background: var(--amber-soft); color: var(--amber); border-color: #f0dcae; }

/* TC-10 (2026-11-17): the B4 re-show above only applies at >=900px, and
   the plain collapse rule (~3646) hides .order-filter-groups at every
   width while the toggle button is display:none at >=768px — so the
   768-899px band could never show or open the filter groups. Re-show
   them in that band (column layout kept — row would squeeze tablets). */
@media (min-width: 768px) and (max-width: 899px) {
  .order-filter-groups { max-height: none; opacity: 1; overflow: visible; }
}

/* Notifications page alignment (2026-11-17): the filter selects use the
   standard .field wrapper (pixel_events/templates pattern) so the shared
   .field select rule gives them the standard border, radius, padding and
   focus state; the flex sizing keeps the two filters side by side with
   no overflow. The empty box keeps the shared dashed .empty style with
   the compact padding of the .empty.plain variant, so it no longer
   dominates the screen when it is the only content below the filters. */
.tn-filters .field { margin: 0; flex: 1 1 160px; min-width: 0; }
.tn-empty { padding: 28px 16px; }

/* Bell dropdown on mobile (2026-11-17): the base .tn-bell-drop rule
   anchors the panel to the bell button's right edge at a fixed 340px
   width, so on a phone viewport it stretches almost to the left edge
   while the avatar column stays open on the right — it reads as shifted
   to one side. Below 900px (exactly the band where the topbar exists)
   anchor the panel to the viewport instead: 16px gutters on both sides,
   matching the topbar's own horizontal padding. Top = topbar height
   (38px button + 10px + 10px padding + notch safe-area) + the base 8px
   gap. width:auto is required: with left, right and width all set, the
   fixed 340px width would win and right:16px would be ignored.
   Desktop is untouched: the topbar (and the bell) hides at >=900px. */
@media (max-width: 899px) {
  .tn-bell-drop {
    position: fixed;
    top: calc(66px + env(safe-area-inset-top));
    left: 16px;
    right: 16px;
    width: auto;
  }
}

/* ===== Billing renewal: disabled pay button must LOOK disabled (2026-11-19) =====
   public/js/billing.js disables the #store-renewal submit while no store
   is checked, but style.css had no .btn:disabled rule, so the disabled
   button rendered solid green — identical to enabled — and clicks did
   nothing. Scoped to #store-renewal only (both the bKash form's and the
   manual-only form's submit live inside it); no generic .btn:disabled
   rule, so no other page's buttons change. */
#store-renewal .btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---- Billing design fixes (2026-11-21, Sabbir-approved) ----
   Page-local to /billing. Append-only: no original rule above is
   edited. 1) Store-row domain wrap: at ≤640px the ~55px middle
   column broke domains mid-word (original .rnw-row-url uses
   overflow-wrap: anywhere, style.css:5418). Rows now wrap to two
   lines — checkbox + domain + expiry on line 1 (checkbox 20px +
   10px gap = 30px), ৳499 + button on line 2 right. The appended
   .rnw-row-url override (same specificity, later wins) breaks only
   on real overflow. 2) "আমার প্ল্যানসমূহ" rows: the shared
   .app-list-item flex (style.css:1303, NOT touched) squeezed the
   trailing hint into the title. Billing-scoped only
   (.billing-plan-list): the body takes the line beside the 32px
   icon + 12px gap (44px), title/meta wrap instead of
   ellipsis-clipping, and the trailing control goes to line 2
   right. NOTE: the body is calc(100% - 44px), not 100% — a 100%
   basis would strand the icon alone on line 1 and push the
   trailing control to line 3. 3) Renewal popup checkout:
   rnwOpenCheckout (app.js:711) moves the same form into
   .rnw-checkout-modal > .modal (max-width 440px), so the rows
   stack there at every viewport. */
@media (max-width: 640px) {
  .rnw-row { flex-wrap: wrap; }
  .rnw-row-main { flex: 1 1 calc(100% - 32px); }
  .rnw-row-price { margin-left: auto; }
  .billing-plan-list .app-list-item { flex-wrap: wrap; }
  .billing-plan-list .app-list-body { flex: 1 1 calc(100% - 44px); }
  .billing-plan-list .app-list-title,
  .billing-plan-list .app-list-meta { white-space: normal; overflow: visible; text-overflow: clip; }
  .billing-plan-list .app-list-item > :last-child { margin-left: auto; }
}
.rnw-row-url { overflow-wrap: break-word; }
.rnw-checkout-modal .rnw-row { flex-wrap: wrap; }
.rnw-checkout-modal .rnw-row-main { flex: 1 1 calc(100% - 30px); }
.rnw-checkout-modal .rnw-row-price { margin-left: auto; }

/* Order ad-source badges (migration 107, 2026-11-22) — beside the
   channel pill in the orders list, detail page and popup. */
.pill.ad-facebook { background: var(--ad-fb-bg); border-color: var(--ad-fb-border); color: var(--ad-fb); }
.pill.ad-instagram { background: linear-gradient(45deg, var(--ad-ig-1), var(--ad-ig-2), var(--ad-ig-3), var(--ad-ig-4), var(--ad-ig-5)); border-color: transparent; color: var(--bg); }
.pill.ad-tiktok { background: var(--ad-tt-bg); border-color: var(--ad-tt-bg); color: var(--ad-tt); }
.pill.ad-google { background: var(--ad-go-bg); border-color: var(--ad-go-border); color: var(--ad-go); }
.pill.ad-whatsapp { background: var(--ad-wa-bg); border-color: var(--ad-wa-border); color: var(--ad-wa); }
.pill.ad-meta { background: var(--ad-me-bg); border-color: var(--ad-me-border); color: var(--ad-me); }
.pill.ad-other { background: var(--bg-soft); color: var(--muted); }
.pill.ad-unknown { background: var(--bg-soft); color: var(--muted); }

/* ===== Orders filter chips: বিজ্ঞাপন clip fix (2026-11-22) =====
 * Sabbir's desktop screenshot: the বিজ্ঞাপন group's Facebook chip read
 * "acebook" and Instagram "nstagram" — first AND last letters cut.
 * Cause: `.order-source-seg .chip` (~2306, written for the 3-chip সোর্স
 * group as "Fix: WooCommerce chip text overflow") is `flex: 1`
 * (= grow 1, shrink 1, basis 0) + `min-width: 0` + centered text
 * (`justify-content: center`, `white-space: nowrap`,
 * `overflow: hidden`). At >=900px the four filter groups split the row
 * equally (`.order-filter-group { flex: 1; min-width: 0 }`, ~5233), so
 * the 6-chip বিজ্ঞাপন group gave every chip an equal ~60px share.
 * Facebook (~76px) and Instagram (~84px) overflowed; a centered flex
 * item overflows equally on BOTH sides, so the first letter was cut on
 * the left and the last on the right — and `text-overflow: ellipsis`
 * never fires on a centered flex item, so no "…" appeared either.
 * TikTok / Meta / সব / অজানা fit, which is why only the two longest
 * labels clipped. The same squeeze hits the সোর্স group ("WooCommerce")
 * and ফ্রড group on laptop widths (<~1830px), so the fix is on the
 * shared rule, not just the ad group.
 * Fix (append-only, same selector, later wins): basis auto + shrink 0
 * — every chip is at least its content wide and never shrinks below
 * it; grow 1 keeps the fill-the-row look when there is slack, and the
 * base `.filters { flex-wrap: wrap }` lets the row wrap to a second
 * line instead of clipping when it is squeezed. Mobile is untouched:
 * <=640px the groups become a 3-column grid (`.order-sticky-head
 * .filters`, ~2152) where grid items ignore flex; the longest label
 * fits a cell at >=320px. No markup, label, order or colour change. */
.order-source-seg .chip {
  flex: 1 0 auto;
}

/* Orders filter labels: hide the group labels (সোর্স / ফ্রড চেক / বিজ্ঞাপন /
 * ফিল্টার) on desktop (Sabbir 2026-11-22) — the chips and selects are
 * self-explanatory there. Labels stay on mobile, where the groups stack
 * in the collapsed card and the headings identify each group. The mobile
 * filter sheet keeps its own .fp-label headings (untouched). */
@media (min-width: 900px) {
  .order-filter-label { display: none; }
}

/* Orders filter strip: one horizontal scroll row (Sabbir 2026-11-22,
 * approved design sample) — the 4 filter groups sit in a single line
 * with thin dividers; overflow scrolls sideways instead of wrapping
 * to a second line (so অজানা never drops below) and never clips.
 * Same strip on mobile: swipeable, no full-screen expanded card.
 * Append-only, later wins at equal specificity over:
 * - base `.order-filter-groups` (column + max-height:0 + opacity:0,
 *   ~3280/~3340) and the <=767px collapse rule
 *   `.order-filter-card:not(.expanded) .order-filter-groups`
 *   (same 0,3,0 specificity as the strip override below);
 * - desktop `.order-filter-group { flex: 1 }` (~5232);
 * - the clip-fix `.order-source-seg .chip { flex: 1 0 auto }` (kept);
 * - the <=640px 3-column grid on `.order-sticky-head .filters`.
 * The a5bfa438 desktop label-hide block above is kept; the strip
 * hides the labels on ALL screens. Sticky behaviour, the fp-sheet,
 * the active-chips row and the search row are untouched. */
.order-filter-strip {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  min-width: 0; max-height: none; opacity: 1;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
  overscroll-behavior-x: contain;
}
.order-filter-strip::-webkit-scrollbar { display: none; }
.order-filter-strip.at-end {
  -webkit-mask-image: none;
  mask-image: none;
}
.order-filter-strip .order-filter-group { flex: 0 0 auto; }
.order-filter-strip .chip { flex: 0 0 auto; }
.order-filter-strip .filters {
  display: flex; gap: 8px; flex-wrap: nowrap;
}
.order-filter-strip .order-filter-label { display: none; }
.order-filter-divider {
  flex: 0 0 auto; width: 1px; height: 24px;
  background: var(--border, #e2e8f0);
}
.order-filter-strip .order-compact-row {
  display: flex; gap: 8px; flex-wrap: nowrap;
}
.order-filter-strip .order-mini-select { flex: 0 0 auto; }
.order-filter-card:not(.expanded) .order-filter-strip {
  max-height: none; opacity: 1; overflow-x: auto;
}
.order-filter-card.expanded .order-filter-strip { max-height: none; }

/* Orders mobile strip spacing + snap, and mobile card tidy-up
 * (2026-11-22, Sabbir's phone screenshot): the strip chips looked
 * stuck together — gaps nearly invisible, dividers unseen — and a
 * swipe stopped on a half-cut chip (সন্দেহজনক); the mobile card
 * meta wrapped across lines because the full date-time with seconds
 * sat in it. Strip: more air, visible dividers, proximity snap so a
 * swipe lands on whole chips. Cards: title + status on top, one tidy
 * meta line, price big left + short date (no seconds) right. */
.order-filter-strip {
  gap: 12px;
  padding: 4px 12px;
  scroll-padding: 0 12px;
  scroll-snap-type: x proximity;
}
.order-filter-strip > .order-filter-group { scroll-snap-align: start; }
.order-filter-divider { height: 28px; margin: 0 4px; background: var(--border, #cbd5e1); }
@media (max-width: 640px) {
  .order-filter-strip .chip { padding: 8px 12px; min-height: 40px; }
}
.order-mobile-list .order-mobile-title-row { display: flex; align-items: flex-start; gap: 8px; }
.order-mobile-list .order-mobile-title-row .app-list-item-title { flex: 1; min-width: 0; }
.order-mobile-list .order-mobile-title-row .pill { flex: 0 0 auto; margin-top: 1px; }
.order-mobile-list .order-mobile-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.order-mobile-list .order-mobile-bottom .app-price { font-size: 1.1rem; }
.order-mobile-list .order-mobile-date { font-size: .75rem; color: var(--muted, #64748b); white-space: nowrap; }

/* Orders filter chips centered in the card (2026-11-22, Sabbir's
 * phone screenshot): the chip row sat glued to the search row above
 * it — the card has gap: 0 and the strip only had 4px top padding —
 * so the chips looked merged with the top of the card. Give the
 * strip a top margin and taller vertical padding: 10px + 8px above
 * the chips, 8px + the card's own 10px bottom padding below them,
 * so the row sits vertically centered in the card. Same on mobile
 * and desktop (no media gate). Horizontal scroll, fade, snap and
 * drag-to-scroll are untouched. */
.order-filter-strip {
  margin-top: 10px;
  padding: 8px 12px;
}

/* Dashboard charts — Workly style (2026-11-22, Sabbir-approved design):
 * the two Woo charts (orders 7 days + revenue 6 months) move from
 * chunky green-gradient bars to slim flat dark bars (#111827, no
 * gradient), with a dashed average line on the orders chart, dark
 * tooltips on hover/tap, a 3-card summary row, and a donut +
 * monthly-share card. SCOPED to .wk-* classes only — the shared
 * bar classes are untouched, so the message-volume chart keeps its
 * old green/blue bars exactly. Same on mobile and
 * desktop (no media gate); bars are min(34px, 58%) of the column so
 * 7 columns fit a 375px card. Bar height is driven by the --bh
 * custom property set inline per column (capped at 86% in the view
 * so the value label fits above the tallest bar); zero columns
 * render a 6px dot on the baseline, never a fake bar. */
.wk-charts { align-items: start; }
.wk-chart { display: flex; flex-direction: column; height: 196px; }
.wk-plot { position: relative; display: flex; gap: 8px; flex: 1; min-height: 0; }
.wk-col { flex: 1; position: relative; height: 100%; min-width: 0; --bh: 0%; cursor: pointer; }
.wk-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; width: min(34px, 58%); height: max(var(--bh), 4px); background: #111827; border-radius: 4px 4px 0 0; }
.wk-zero .wk-bar { width: 6px; height: 6px; border-radius: 50%; }
.wk-val { position: absolute; left: 0; right: 0; bottom: calc(max(var(--bh), 4px) + 4px); text-align: center; font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.wk-labs { display: flex; gap: 8px; margin-top: 6px; }
.wk-lab { flex: 1; min-width: 0; text-align: center; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-avg { position: absolute; left: 0; right: 0; border-top: 1px dashed #94a3b8; pointer-events: none; }
.wk-avg span { position: absolute; right: 0; top: -9px; background: #fff; padding: 0 4px; font-size: .68rem; color: var(--muted); }
.wk-tip { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(max(var(--bh), 4px) + 26px); background: #111827; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .75rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; }
.wk-col:first-child .wk-tip { left: 0; transform: none; }
.wk-col:last-child .wk-tip { left: auto; right: 0; transform: none; }
.wk-col:hover .wk-tip { opacity: 1; }
.wk-col.wk-on .wk-tip { opacity: 1; }
.wk-donut-wrap { display: flex; align-items: center; gap: 16px; }
.wk-donut { width: 132px; height: 132px; flex: 0 0 auto; }
.wk-donut-track { fill: none; stroke: #e5e7eb; stroke-width: 15; }
.wk-donut-arc { fill: none; stroke: #111827; stroke-width: 15; stroke-linecap: round; }
.wk-donut-pct { font-size: 1.35rem; font-weight: 800; fill: #0f172a; text-anchor: middle; dominant-baseline: central; }
.wk-donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: .82rem; color: var(--muted); }
.wk-donut-legend .leg { display: inline-flex; align-items: center; gap: 6px; }
.wk-donut-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.wk-donut-legend b { color: #0f172a; font-variant-numeric: tabular-nums; }
.wk-dist { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.wk-dist-row { display: flex; align-items: center; gap: 8px; font-size: .8rem; }
.wk-dist-lab { flex: 0 0 52px; color: var(--muted); }
.wk-dist-track { flex: 1; height: 7px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.wk-dist-fill { display: block; height: 100%; background: #111827; border-radius: 999px; }
.wk-dist-val { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Mobile order cards + filter strip tidy-up (2026-11-22, Sabbir's phone
 * screenshot safejo.net/orders + live-call order): the strip's last
 * chip ("ফ্রড: সব") was cut at the card edge, "·" separators hung at
 * line ends, customer names cut mid-name ("Mu…"), the thumb floated
 * vertically centered in a tall text block, and the chevron floated
 * mid-card. The status pill moves next to the source pill (live call).
 * Mobile ONLY (<900px): desktop keeps the approved scroll strip and
 * the desktop table is untouched. */
@media (max-width: 899px) {
  /* (1) Filter strip wraps on mobile so every chip shows fully.
   * Desktop (>=900px) keeps the approved horizontal scroll + fade +
   * snap. The :not(.expanded) selector matches the collapse-override
   * specificity so overflow-x: visible actually wins; margin-top +
   * padding re-declare the chip-centering values so the effective
   * (last) strip rule still carries them. Dividers hide in wrap mode
   * via the strip's direct-child aria-hidden spans (its only such
   * children) — no bare divider rule, so the divider-styling pin
   * keeps reading the 28px rule. */
  .order-filter-card:not(.expanded) .order-filter-strip,
  .order-filter-strip {
    flex-wrap: wrap;
    overflow-x: visible;
    overflow-y: visible;
    -webkit-mask-image: none;
    mask-image: none;
    scroll-snap-type: none;
    margin-top: 10px;
    padding: 8px 12px;
  }
  .order-filter-strip > span[aria-hidden="true"] { display: none; }
  .order-filter-strip .order-filter-group { flex: 1 1 auto; min-width: 0; }
  .order-filter-strip .filters { flex-wrap: wrap; }
  .order-filter-strip .order-compact-row { flex-wrap: wrap; }
  .order-filter-strip .order-mini-select { flex: 1 1 auto; min-width: 0; }
  /* (2) Status pill sits next to the source pill (live-call order).
   * The title row now carries only "অর্ডার #N · নাম". */
  /* (3) Full customer name: the title may wrap to a second line
   * instead of cutting mid-name. */
  .order-mobile-list .order-mobile-title-row .app-list-item-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  /* Meta segments are atomic flex items with no literal separators,
   * so no dot can hang at a line end. */
  .order-mobile-list .app-list-item-meta .om-seg { white-space: nowrap; }
  .order-mobile-list .app-list-item-meta .om-store {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Source badge + status pill side by side (+ fraud pill + রিভিউ
   * when present). The pills themselves are unchanged. */
  .order-mobile-list .order-mobile-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }
  .order-mobile-list .order-mobile-pills .fraud-review-link {
    font-size: .75rem;
    white-space: nowrap;
    cursor: pointer;
    color: var(--brand);
    text-decoration: underline;
  }
  /* (4)+(5) Thumb + chevron anchor to the top of the card instead of
   * floating at its vertical middle (the shared mobile grid centers
   * them; the 3-class selector ties its specificity). */
  .order-mobile-list.only-mobile .app-list-item { align-items: start; }
  .order-mobile-list .order-thumb-mobile { margin-top: 2px; }
  .order-mobile-list .app-list-item > .icon-wrap { align-self: start; margin-top: 2px; }
  /* (6) Price + date stay on one clean line. */
  .order-mobile-list .order-mobile-bottom { flex-wrap: nowrap; }
  .order-mobile-list .order-mobile-bottom .app-price { white-space: nowrap; }
}

/* Orders filter strip: restore horizontal scroll on mobile
 * (2026-11-23, Sabbir's order): the 2026-11-22 tidy-up wrapped the
 * strip below 900px so the last chip ("ফ্রড: সব") would not clip at
 * the card edge — but wrapping turned the filter row into a
 * full-screen stacked block and killed the approved scroll strip.
 * Restore the scroll strip and fix the clipped chip the proper way
 * instead: the strip's own 12px of right padding (plus the
 * proximity snap) lets the last chip scroll fully into view — no
 * extra padding is needed, so the effective padding stays exactly
 * the centering rule's 8px 12px and the 18px/18px centering math
 * is untouched. The rest of the tidy-up block (status pill beside
 * the source pill, full-name title, top-anchored thumb + chevron,
 * one-line price + date) is untouched, and desktop (>=900px) keeps
 * the approved scroll strip exactly as before. Specificity: the
 * :not(.expanded) selector matches the tidy-up override, so
 * overflow-x: auto wins over its visible. */
@media (max-width: 899px) {
  .order-filter-card:not(.expanded) .order-filter-strip,
  .order-filter-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
    scroll-snap-type: x proximity;
    scroll-padding: 0 12px;
    margin-top: 10px;
    padding: 8px 12px;
  }
  .order-filter-strip > span[aria-hidden="true"] { display: block; }
  .order-filter-strip .order-filter-group { flex: 0 0 auto; }
  .order-filter-strip .filters { flex-wrap: nowrap; }
  .order-filter-strip .order-compact-row { flex-wrap: nowrap; }
  .order-filter-strip .order-mini-select { flex: 0 0 auto; }
}

/* Mobile order card: one-line customer name + vertically centered
 * product photo (2026-11-23, Sabbir's order, voice call):
 * (1) the 2026-11-22 tidy-up let the full name wrap to a second
 * line instead of cutting it mid-name ("Mu…") — Sabbir now wants
 * the name on ONE line always, long or short, truncating with …
 * (same 3-class selector as the tidy-up rule, later wins).
 * (2) the tidy-up top-anchored the product photo, so it rode at
 * the very top of the card — center it vertically instead
 * (align-self on the thumb itself; the text rows and the chevron
 * do not move). The fallback ticket icon shares the .icon-wrap
 * selector with the chevron, so it is centered via its own
 * .neutral class and the chevron keeps its top anchor.
 * Desktop (>=900px) untouched. */
@media (max-width: 899px) {
  .order-mobile-list .order-mobile-title-row .app-list-item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .order-mobile-list .order-thumb-mobile {
    align-self: center;
    margin-top: 0;
  }
  .order-mobile-list .app-list-item > .icon-wrap.neutral {
    align-self: center;
    margin-top: 0;
  }
}

.sj-landing, .sj-topbar, .sj-foot{
  --bg:#f4f7f5; --surface:#ffffff; --surface2:#edf3f0;
  --ink:#0d1f18; --muted:#54665d; --line:#dce7e1;
  --brand:#0a7a5c; --brand2:#065c44; --brand-soft:#e4f3ed;
  --dark:#0a1f18; --radius:20px;
  --shadow:0 24px 60px rgba(9,30,22,.14);
  --device-shadow:0 50px 90px -30px rgba(4,24,17,.5);
}
.sj-landing a{color:inherit;text-decoration:none}
/* 2026-11-23 header/footer v2 (M1/D1): the unprefixed-looking `.sj-landing a`
   rule above is (0,1,1) and beats the (0,1,0) .sj-btn-primary/.sj-app-btn
   colour rules, so every primary CTA and the Android button rendered DARK
   text (#0d1f18) on green/dark. These (0,2,1) overrides restore white. */
.sj-landing a.sj-btn-primary{color:#fff}
.sj-landing a.sj-app-btn{color:#fff}
.sj-landing h1, .sj-landing h2, .sj-landing h3, .sj-landing p, .sj-landing ul{margin:0}
.sj-landing ul{padding:0;list-style:none}
svg.ic{display:inline-block;vertical-align:middle;flex:none}
/* Icon sizes — the approved design sets every icon's px size explicitly; the app's
   icon() helper renders class="ic" at 1.2em, so the approved sizes are pinned
   here, scoped to .sj-landing (nothing else changes). */
.sj-landing .sj-micro .ic{width:15px;height:15px}
.sj-landing .sj-kicker .ic{width:14px;height:14px}
.sj-landing .sj-hstat .sj-hic .ic{width:19px;height:19px}
.sj-landing .sj-logo-mark .ic{width:20px;height:20px}
.sj-landing .sj-nav-cta .ic{width:16px;height:16px}
.sj-landing .sj-hero .sj-btn .ic{width:18px;height:18px}
.sj-landing .sj-example-badge .ic{width:19px;height:19px}
.sj-landing .sj-float-card .ic{width:19px;height:19px}
.sj-landing .sj-url-pill .ic{width:11px;height:11px}
.sj-landing .sj-browser-bar>.ic{width:15px;height:15px}
.sj-landing .sj-side a .ic{width:15px;height:15px}
.sj-landing .sj-side-brand .sj-logo-mark .ic{width:14px;height:14px}
.sj-landing .sj-side-foot .ic{width:13px;height:13px}
.sj-landing .sj-live-strip .ic{width:15px;height:15px}
.sj-landing .sj-kcard .sj-kic .ic{width:14px;height:14px}
.sj-landing .sj-kcard em .ic{width:11px;height:11px}
.sj-landing .sj-chart-head .ic{width:12px;height:12px}
.sj-landing .sj-order-row .sj-who .ic{width:14px;height:14px}
.sj-landing .sj-phone-head .ic{width:17px;height:17px}
.sj-landing .sj-bubble .sj-ai-tag .ic{width:11px;height:11px}
.sj-landing .sj-bubble .sj-meta .ic{width:14px;height:14px}
.sj-landing .sj-input-box .ic{width:17px;height:17px}
.sj-landing .sj-input-box span .ic{width:16px;height:16px}
.sj-landing .sj-send-btn .ic{width:17px;height:17px}
.sj-landing .sj-note .ic{width:16px;height:16px}
.sj-landing .sj-feat-icon .ic{width:25px;height:25px}
.sj-landing .sj-step .sj-sic .ic{width:30px;height:30px}
.sj-landing .sj-about-card .sj-aic .ic{width:22px;height:22px}
.sj-landing .sj-foot-contact .ic{width:16px;height:16px}
.sj-landing .sj-ab-ic .ic{width:19px;height:19px}
.sj-landing .sj-ios-soon .ic{width:17px;height:17px}
.sj-landing .sj-fb-mid .ic{width:14px;height:14px}
.sj-wrap{max-width:1180px;margin:0 auto;padding:0 20px}
/* ---------- NAV ---------- */
.sj-topbar{position:sticky;top:0;z-index:60;background:color-mix(in srgb, var(--bg) 86%, transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}
.sj-nav{display:flex;align-items:center;justify-content:space-between;height:68px;gap:16px}
.sj-logo{display:flex;align-items:center;gap:10px;font-weight:800;font-size:24px;letter-spacing:-.02em}
.sj-logo-mark{width:38px;height:38px;border-radius:11px;background:linear-gradient(145deg,#0d8a66,#065c44);color:#fff;display:grid;place-items:center;box-shadow:0 8px 18px rgba(10,122,92,.35)}
.sj-logo em{font-style:normal;color:var(--brand)}
.sj-navlinks{display:flex;gap:4px;align-items:center}
.sj-navlinks a{padding:10px 14px;border-radius:999px;font-weight:600;font-size:15px;color:var(--muted);transition:.2s}
.sj-navlinks a:hover{background:var(--surface2);color:var(--ink)}
.sj-nav-cta{display:flex;gap:8px;align-items:center}
.sj-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:13px 24px;border-radius:999px;font-weight:700;font-size:16px;border:1px solid transparent;cursor:pointer;transition:transform .2s, background .2s, box-shadow .2s;min-height:48px}
.sj-btn-primary{background:var(--brand);color:#fff;box-shadow:0 12px 26px rgba(10,122,92,.3)}
.sj-btn-primary:hover{background:var(--brand2);transform:translateY(-2px)}
.sj-btn-ghost{background:var(--surface);border-color:var(--line);color:var(--ink)}
.sj-btn-ghost:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.sj-btn-sm{padding:10px 18px;font-size:15px;min-height:44px}
@media (max-width:820px){.sj-navlinks{display:none}}
/* ---------- HERO ---------- */
.sj-hero{position:relative;padding:64px 0 10px;overflow:hidden;background:
  radial-gradient(820px 420px at 12% -12%, rgba(10,122,92,.16) 0%, transparent 60%),
  radial-gradient(760px 420px at 92% -6%, rgba(242,183,5,.13) 0%, transparent 55%), var(--bg)}
.sj-hero-inner{max-width:820px;margin:0 auto;text-align:center;position:relative;z-index:2}
.sj-pill{display:inline-flex;gap:9px;align-items:center;background:linear-gradient(180deg,var(--surface),var(--brand-soft));border:1px solid var(--line);padding:8px 15px;border-radius:999px;font-size:13.5px;font-weight:700;box-shadow:0 6px 18px rgba(9,30,22,.06);max-width:100%}
.sj-pill .ic{color:var(--brand)}
.sj-pill .sj-dot{flex:none}
.sj-pill-text{min-width:0;text-align:left;line-height:1.4}
@media (max-width:640px){
  .sj-pill{font-size:clamp(10px,2.9vw,12.5px);padding:8px 12px;gap:7px;border-radius:999px;max-width:100%;white-space:nowrap}
  .sj-pill-text{white-space:nowrap}
}
.sj-dot{width:8px;height:8px;border-radius:50%;background:#16a34a;box-shadow:0 0 0 5px rgba(22,163,74,.18);animation:sj-pulse 1.8s infinite}
@keyframes sj-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.3)}}
.sj-landing h1{font-size:clamp(36px,5.4vw,60px);line-height:1.14;letter-spacing:-.02em;margin:22px 0 18px;font-weight:800}
h1 .sj-hl{color:var(--brand);white-space:nowrap}
.sj-lead{font-size:19px;color:var(--muted);max-width:640px;margin:0 auto}
.sj-cta-row{display:flex;flex-wrap:wrap;gap:12px;margin:28px 0 18px;justify-content:center}
.sj-micro{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.sj-micro span{display:inline-flex;align-items:center;gap:6px;background:var(--brand-soft);color:var(--brand2);padding:8px 13px;border-radius:999px;font-weight:700;font-size:13.5px;white-space:nowrap}
.sj-micro .ic{color:var(--brand)}
/* Mobile: trust chips in a tidy 2-column grid (last chip spans the row),
   stat cards side by side as three compact equal columns */
@media (max-width:640px){
  /* Trust chips: content-sized pills, never stretched into fixed columns —
     the tick sits right next to the text (5px) and every label, including
     "প্রতি স্টোর ৳৪৯৯/মাস থেকে", stays on ONE line at any phone width */
  .sj-micro{display:flex;flex-wrap:wrap;gap:8px;max-width:440px;margin-left:auto;margin-right:auto}
  .sj-micro span{justify-content:center;text-align:center;padding:8px 12px;font-size:clamp(12px,3.3vw,13px);line-height:1.3;gap:5px;white-space:nowrap}
}
.sj-hero-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;max-width:780px;margin:30px auto 0}
.sj-hstat{display:flex;align-items:center;gap:11px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:11px 18px 11px 13px;text-align:left}
.sj-hstat .sj-hic{width:38px;height:38px;border-radius:11px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center}
.sj-hstat b{font-size:16.5px;line-height:1.2;display:block}
.sj-hstat small{color:var(--muted);font-weight:600;font-size:12.5px;line-height:1.25;display:block}
/* Mobile hero stat cards — placed AFTER the base .sj-hero-stats/.sj-hstat rules
   above so this one-column layout actually wins the cascade: each card is a
   full-width row, icon on the left, title and subtitle each on their own
   single line, nothing clipped or squeezed */
@media (max-width:640px){
  .sj-hero-stats{grid-template-columns:1fr;gap:10px;margin-top:24px;max-width:440px}
  .sj-hstat{flex-direction:row;align-items:center;text-align:left;gap:12px;padding:12px 16px 12px 12px;border-radius:16px}
  .sj-hstat .sj-hic{width:40px;height:40px;border-radius:12px}
  .sj-hstat b{font-size:15.5px;white-space:nowrap}
  .sj-hstat small{font-size:12.5px;white-space:nowrap;margin-top:1px}
}
/* ---------- DEVICE STAGE ---------- */
.sj-stage{position:relative;max-width:960px;margin:58px auto 0;padding:0 6px 40px;z-index:1}
.sj-example-badge{position:absolute;top:-28px;left:50%;transform:translateX(-50%);z-index:20;background:var(--surface);border:1px solid var(--line);color:var(--ink);padding:9px 16px 9px 9px;border-radius:18px;box-shadow:0 18px 38px rgba(9,30,22,.16),0 3px 10px rgba(9,30,22,.06);display:inline-flex;align-items:center;gap:11px;text-align:left;max-width:calc(100vw - 28px)}
.sj-example-badge .sj-eb-icon{width:40px;height:40px;border-radius:12px;background:linear-gradient(145deg,#0d8a66,#065c44);color:#fff;display:grid;place-items:center;flex:none;box-shadow:0 8px 16px rgba(10,122,92,.28),inset 0 1px 0 rgba(255,255,255,.25)}
.sj-example-badge .sj-eb-copy{display:flex;flex-direction:column;gap:1px;min-width:0;line-height:1.3}
.sj-example-badge .sj-eb-title{display:inline-flex;align-items:center;gap:7px;font-size:13.5px;font-weight:800;letter-spacing:-.01em;white-space:nowrap}
.sj-example-badge .sj-eb-title .sj-dot{width:7px;height:7px;background:#16a34a;box-shadow:0 0 0 4px rgba(22,163,74,.16)}
.sj-example-badge .sj-eb-sub{font-size:12px;font-weight:600;color:var(--muted);white-space:nowrap}
.sj-example-badge .sj-eb-live{flex:none;font-family:Inter;font-size:10px;font-weight:800;letter-spacing:.08em;color:var(--brand2);background:var(--brand-soft);border:1px solid var(--line);padding:4px 8px;border-radius:999px;margin-left:2px}
/* 2026-11-23 header/footer v2: the deck is gone, so the floor shadow sits
   just under the lid (was bottom:26px/58px tall under the deck). */
.sj-stage-floor{position:absolute;left:4%;right:4%;bottom:6px;height:36px;background:radial-gradient(50% 100% at 50% 50%, rgba(4,24,17,.48), transparent 70%);filter:blur(7px)}
/* Laptop — aluminium body, thin black bezel, webcam. SCREEN ONLY
   (2026-11-23, Sabbir's order: no keyboard deck — the hinge + deck rules
   are deleted below with the markup). */
.sj-laptop{position:relative;z-index:2;animation:sj-floaty 9s ease-in-out infinite}
.sj-laptop-lid{position:relative;background:linear-gradient(105deg, rgba(255,255,255,.17), rgba(255,255,255,0) 42%),linear-gradient(180deg,#5d646e,#22252b 55%,#121419);border-radius:24px;padding:13px 13px 16px;box-shadow:inset 0 1px 0 rgba(255,255,255,.35), inset 2px 0 3px rgba(255,255,255,.07), inset -2px 0 3px rgba(0,0,0,.45), inset 0 -6px 8px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.06), var(--device-shadow)}
.sj-webcam{position:absolute;top:5px;left:50%;transform:translateX(-50%);width:7px;height:7px;border-radius:50%;background:radial-gradient(circle at 35% 35%, #5b8dd9 0 22%, #10151d 60%);box-shadow:0 0 0 2px rgba(255,255,255,.05);z-index:8}
.sj-screen{position:relative;background:#f3f6f4;border-radius:13px;overflow:hidden;color:#0f1f1a;box-shadow:inset 0 0 0 1px rgba(0,0,0,.25)}
.sj-screen::after{content:"";position:absolute;inset:0;z-index:30;pointer-events:none;background:linear-gradient(112deg, transparent 32%, rgba(255,255,255,.09) 46%, rgba(255,255,255,.02) 54%, transparent 66%)}
.sj-browser-bar{display:flex;align-items:center;gap:12px;background:#e9edeb;padding:9px 14px;border-bottom:1px solid #dbe2de}
.sj-bdots{display:flex;gap:7px}
.sj-bdots i{width:11px;height:11px;border-radius:50%;display:block}
.sj-bdots i:nth-child(1){background:#ff5f57}
.sj-bdots i:nth-child(2){background:#febc2e}
.sj-bdots i:nth-child(3){background:#28c840}
.sj-url-pill{flex:1;max-width:430px;margin:0 auto;background:#fff;border:1px solid #dde3df;border-radius:8px;font-family:Inter;font-size:11.5px;color:#5b6b64;padding:5px 12px;display:flex;align-items:center;justify-content:center;gap:7px}
.sj-url-pill .ic{color:var(--brand)}
.sj-browser-bar .ic{color:#7b8a82}
.sj-dash{display:grid;grid-template-columns:158px 1fr;min-height:342px}
.sj-side{background:linear-gradient(180deg,#0c231b,#081711);color:#c4d6cc;padding:16px 10px;display:flex;flex-direction:column;gap:2px}
.sj-side-brand{display:flex;align-items:center;gap:8px;color:#fff;font-weight:800;font-size:13.5px;padding:2px 8px 14px}
.sj-side-brand .sj-logo-mark{width:26px;height:26px;border-radius:8px}
.sj-side a{display:flex;align-items:center;gap:9px;font-size:12.5px;font-weight:600;padding:8px 9px;border-radius:9px;color:#9db8ab;cursor:pointer}
.sj-side a .ic{opacity:.85}
.sj-side a.sj-active{background:#14684d;color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.15)}
.sj-side a:hover{background:rgba(255,255,255,.06);color:#fff}
.sj-side .sj-side-foot{margin-top:auto;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.09);border-radius:11px;padding:10px;font-size:11px;line-height:1.45;color:#b9cec2}
.sj-side .sj-side-foot b{color:#fff;display:flex;align-items:center;gap:6px;font-size:11.5px;margin-bottom:3px}
.sj-main{padding:16px 16px 14px;position:relative;background:linear-gradient(180deg,#fbfcfb,#f1f5f2)}
.sj-main-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.sj-main h3{font-size:15.5px;line-height:1.3}
.sj-main .sj-sub{font-size:11.5px;color:#68786f;margin-top:1px}
.sj-live-badge{display:inline-flex;align-items:center;gap:7px;background:#0c231b;color:#d9f5e6;font-size:11px;font-weight:700;padding:6px 11px;border-radius:999px;white-space:nowrap}
.sj-live-badge .sj-dot{background:#4ade80;box-shadow:0 0 0 4px rgba(74,222,128,.22)}
.sj-live-strip{display:flex;align-items:center;gap:9px;background:#e9f6ef;border:1px solid #cfe9da;border-radius:11px;padding:8px 12px;margin:11px 0;font-size:12.5px;font-weight:600;color:#14532d;min-height:37px}
.sj-live-strip .ic{color:var(--brand)}
.sj-live-strip #liveText{transition:opacity .35s, transform .35s}
.sj-live-strip #liveText.sj-swap{opacity:0;transform:translateY(5px)}
.sj-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}
.sj-kcard{background:#fff;border:1px solid #e3eae6;border-radius:13px;padding:11px 12px;box-shadow:0 3px 10px rgba(9,30,22,.04)}
.sj-kcard .sj-ktop{display:flex;align-items:center;justify-content:space-between}
.sj-kcard small{font-size:10.5px;color:#68786f;font-weight:700}
.sj-kcard .sj-kic{width:26px;height:26px;border-radius:8px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center}
.sj-kcard strong{font-family:Inter;font-size:21px;display:block;line-height:1.15;margin-top:3px}
.sj-kcard em{font-style:normal;font-size:10.5px;color:#059669;font-weight:700;display:flex;align-items:center;gap:3px}
.sj-chart{background:#fff;border:1px solid #e3eae6;border-radius:13px;padding:12px 13px;margin-top:9px;box-shadow:0 3px 10px rgba(9,30,22,.04)}
.sj-chart-head{display:flex;justify-content:space-between;align-items:center}
.sj-chart-head strong{font-size:12.5px}
.sj-chart-head span{font-size:11px;color:#68786f;display:flex;align-items:center;gap:5px}
.sj-bars-wrap{position:relative;margin-top:6px}
.sj-bars{display:flex;align-items:flex-end;gap:10px;height:88px;padding-top:6px}
.sj-bar{flex:1;max-width:38px;margin:0 auto;width:100%;background:linear-gradient(180deg,#0d2f24,#081c14);border-radius:7px 7px 3px 3px;min-height:7px;transform-origin:bottom;animation:sj-grow 1s cubic-bezier(.22,.61,.36,1) both;animation-delay:var(--d,0s)}
.sj-bar.sj-alt{background:linear-gradient(180deg,#12a173,#0a7a5c)}
.sj-bar.sj-today{box-shadow:0 0 0 3px rgba(10,122,92,.18)}
@keyframes sj-grow{from{transform:scaleY(0)}to{transform:scaleY(1)}}
.sj-avg-line{position:absolute;left:0;right:0;bottom:34%;border-top:2px dashed #94a89d;opacity:.75}
.sj-avg-line span{position:absolute;right:0;top:-19px;font-size:10px;font-weight:700;color:#68786f;background:#fff;padding:1px 6px;border-radius:6px;border:1px dashed #c3d2c9}
.sj-labels{display:flex;gap:10px}
.sj-labels span{flex:1;text-align:center;font-size:10.5px;color:#68786f;padding-top:6px}
.sj-orders{margin-top:9px;background:#fff;border:1px solid #e3eae6;border-radius:13px;padding:5px 13px;box-shadow:0 3px 10px rgba(9,30,22,.04)}
.sj-order-row{display:flex;justify-content:space-between;align-items:center;font-size:12.5px;padding:8px 0;border-bottom:1px solid #eef3f0}
.sj-order-row:last-child{border:0}
.sj-order-row .sj-who{display:flex;align-items:center;gap:8px}
.sj-order-row .sj-who .ic{color:#8ba398}
.sj-badge{font-size:10.5px;font-weight:700;padding:3px 9px;border-radius:999px;background:#dcfce7;color:#166534}
.sj-badge.sj-blue{background:#dbeafe;color:#1d4ed8}
.sj-badge.sj-amber{background:#fef3c7;color:#92400e}
/* Phone — metal frame, side buttons, Dynamic Island, status bar */
/* 2026-11-23 header/footer v2: phone narrowed 264px -> 220px. The phone
   (563px tall at 264px) is taller than the lid-only laptop (~406px), so at
   full size it forced either a ~130px empty band under the lid or an
   overlap with the hero stats above. At 220px (469px tall) it keeps the
   same bottom:16px overlap with 19px clearance under the stats. */
.sj-phone{position:absolute;right:-16px;bottom:16px;width:220px;aspect-ratio:9/19.2;z-index:10;background:linear-gradient(155deg,#4a5058,#0a0c0f 38%,#1b1e23);border-radius:46px;padding:11px;box-shadow:inset 0 0 0 2px #5c636d, inset 0 0 0 5px #000, 0 44px 70px -20px rgba(4,24,17,.6);animation:sj-floaty 7.5s ease-in-out infinite}
.sj-pbtn{position:absolute;background:#33373d;border-radius:3px}
.sj-pbtn.sj-power{right:-3.5px;top:196px;width:3.5px;height:74px}
.sj-pbtn.sj-vol1{left:-3.5px;top:160px;width:3.5px;height:44px}
.sj-pbtn.sj-vol2{left:-3.5px;top:212px;width:3.5px;height:44px}
.sj-pbtn.sj-mute{left:-3.5px;top:118px;width:3.5px;height:24px}
.sj-phone-screen{position:relative;background:#e7dfd3;border-radius:36px;overflow:hidden;display:flex;flex-direction:column;height:100%;min-height:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.35)}
.sj-phone-screen::after{content:"";position:absolute;inset:0;z-index:20;pointer-events:none;background:linear-gradient(115deg, transparent 40%, rgba(255,255,255,.10) 50%, transparent 62%)}
.sj-island{position:absolute;top:10px;left:50%;transform:translateX(-50%);width:84px;height:23px;background:#000;border-radius:999px;z-index:25;display:flex;align-items:center;justify-content:flex-end;padding-right:8px}
.sj-island i{width:8px;height:8px;border-radius:50%;background:radial-gradient(circle at 35% 35%, #4a6ea8 0 30%, #0a0f16 65%);display:block}
.sj-statusbar{display:flex;justify-content:space-between;align-items:center;padding:10px 20px 4px;font-family:Inter;font-size:11.5px;font-weight:700;color:#111}
.sj-statusbar .sj-sicons{display:flex;gap:5px;align-items:center;color:#111}
.sj-phone-head{background:#075e54;color:#fff;padding:8px 11px 9px;display:flex;gap:8px;align-items:center;box-shadow:0 1px 4px rgba(0,0,0,.18);position:relative;z-index:2}
.sj-phone-head .ic{opacity:.95}
.sj-avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(145deg,#d9f2e4,#a7dcc0);color:#075e54;display:grid;place-items:center;font-weight:800;font-size:14px}
.sj-phone-head .sj-pname{font-weight:700;font-size:13.5px;line-height:1.2}
.sj-phone-head .sj-pstat{font-size:11px;opacity:.85;line-height:1.2}
.sj-chat{padding:11px 10px;display:flex;flex-direction:column;gap:7px;flex:1;min-height:0;overflow:hidden;background-image:radial-gradient(rgba(7,94,84,.07) 1px, transparent 1.4px);background-size:16px 16px}
.sj-bubble{max-width:87%;padding:7px 9px 5px;border-radius:12px;font-size:12.5px;line-height:1.42;box-shadow:0 1px 2px rgba(0,0,0,.13);transition:opacity .45s, transform .45s;position:relative}
.sj-bubble.sj-hide-b{opacity:0;transform:translateY(9px)}
.sj-bubble.sj-show{opacity:1;transform:none}
.sj-bubble.sj-in{background:#fff;align-self:flex-start;border-top-left-radius:3px}
.sj-bubble.sj-ai{background:#e7ffdb;align-self:flex-end;border-top-right-radius:3px}
.sj-bubble .sj-meta{display:flex;justify-content:flex-end;align-items:center;gap:4px;font-size:10px;color:#7a8a80;margin-top:3px}
.sj-bubble .sj-meta .ic{color:#34b7f1}
.sj-ai-tag{font-size:10px;font-weight:800;color:#0a7a5c;display:inline-flex;align-items:center;gap:4px;letter-spacing:.02em}
.sj-typing{align-self:flex-end;background:#fff;padding:10px 13px;border-radius:12px;border-top-right-radius:3px;display:none;gap:4px;box-shadow:0 1px 2px rgba(0,0,0,.13)}
.sj-typing.sj-show{display:flex}
.sj-typing i{width:7px;height:7px;border-radius:50%;background:#9db3a8;animation:sj-blink 1s infinite}
.sj-typing i:nth-child(2){animation-delay:.15s}
.sj-typing i:nth-child(3){animation-delay:.3s}
@keyframes sj-blink{0%,100%{opacity:.3;transform:translateY(0)}50%{opacity:1;transform:translateY(-2px)}}
.sj-phone-input{background:#f0ebe3;padding:7px 9px 5px;position:relative;z-index:2}
.sj-input-row{display:flex;gap:7px;align-items:center}
.sj-input-box{flex:1;background:#fff;border-radius:999px;padding:8px 12px;font-size:12.5px;color:#93a29a;display:flex;align-items:center;gap:8px;box-shadow:0 1px 2px rgba(0,0,0,.07)}
.sj-input-box .ic{color:#8fa398}
.sj-send-btn{width:38px;height:38px;border-radius:50%;background:#00a884;color:#fff;display:grid;place-items:center;box-shadow:0 4px 10px rgba(0,168,132,.4)}
.sj-home-bar{width:110px;height:4.5px;border-radius:99px;background:rgba(10,10,10,.4);margin:7px auto 2px}
@keyframes sj-floaty{0%,100%{transform:translateY(0)}50%{transform:translateY(-9px)}}
/* Floating live cards */
.sj-float-card{position:absolute;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:11px 14px 11px 11px;box-shadow:var(--shadow);font-size:13px;font-weight:700;z-index:15;display:flex;gap:10px;align-items:center;animation:sj-floaty 6.5s ease-in-out infinite}
.sj-float-card small{color:var(--muted);font-weight:600;display:block;font-size:11.5px}
.sj-float-card .sj-fic{width:38px;height:38px;border-radius:12px;display:grid;place-items:center}
.sj-float1{left:-34px;top:110px}
.sj-float2{left:-22px;bottom:120px;animation-delay:1.4s}
.sj-float1 .sj-fic{background:#e4f3ed;color:var(--brand)}
.sj-float2 .sj-fic{background:#fef3c7;color:#b45309}
@media (max-width:1180px){.sj-float-card{display:none}}
@media (max-width:980px){
  .sj-stage{padding-bottom:20px}
  .sj-phone{position:relative;right:auto;bottom:auto;margin:30px auto 0;width:min(262px,74vw)}
  .sj-dash{grid-template-columns:1fr}.sj-side{display:none}
  .sj-cards{grid-template-columns:repeat(2,1fr)}
  .sj-laptop{animation:none}
}
/* Phone: laptop goes near full-width — thin even bezel. Inside, the dashboard
   is shown the way a real laptop screenshot looks: the complete desktop
   dashboard (sidebar, live strip, 4 KPI cards, chart, orders) scaled down
   proportionally with zoom — never reflowed, squeezed or cut — so
   proportions, spacing and alignment stay exactly like the real thing.
   Phone mockup untouched. (2026-11-23: screen-only laptop — no deck.) */
@media (max-width:640px){
  .sj-stage{padding:0 0 20px;margin:46px -14px 0}
  /* Phone view: laptop hidden completely (the lid is inside .sj-laptop)
     — only the phone mockup is shown */
  .sj-laptop{display:none}
  /* Live-preview card sits at the TOP CORNER of the phone view */
  .sj-example-badge{top:-24px;left:2px;right:auto;transform:none;padding:8px 12px 8px 8px;border-radius:16px;gap:9px;max-width:94vw}
  .sj-example-badge .sj-eb-icon{width:34px;height:34px;border-radius:10px}
  .sj-example-badge .sj-eb-title{font-size:12.5px}
  .sj-example-badge .sj-eb-sub{font-size:11px;white-space:normal;line-height:1.35}
  .sj-example-badge .sj-eb-live{display:none}
  .sj-laptop-lid{padding:8px 8px 10px;border-radius:15px;box-shadow:inset 0 1px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.06), var(--device-shadow)}
  .sj-webcam{top:3px;width:5px;height:5px}
  .sj-screen{border-radius:7px}
  .sj-browser-bar{gap:8px;padding:7px 10px}
  .sj-bdots{gap:5px}.sj-bdots i{width:8px;height:8px}
  .sj-browser-bar>.ic{display:none}
  .sj-url-pill{font-size:10.5px;padding:4px 8px}
  .sj-dash{zoom:.48;width:208.34%;grid-template-columns:158px 1fr}
  .sj-side{display:flex}
  .sj-cards{grid-template-columns:repeat(4,1fr)}
}
.sj-note{max-width:860px;margin:26px auto 0;background:#fffbeb;border:1px solid #fde68a;color:#92400e;border-radius:13px;padding:11px 16px;font-size:13.5px;font-weight:600;text-align:center;display:flex;gap:9px;align-items:center;justify-content:center}
.sj-note .ic{flex:none}
/* ---------- SECTIONS ---------- */
.sj-landing section{padding:70px 0}
.sj-sec-head{max-width:720px;margin:0 auto 30px;text-align:center}
.sj-sec-head .sj-kicker{display:inline-flex;align-items:center;gap:7px}
.sj-sec-head h1, .sj-sec-head h2{font-size:clamp(27px,3.6vw,39px);line-height:1.2;margin:10px 0 10px;letter-spacing:-.01em}
.sj-sec-head p{color:var(--muted);font-size:16.5px}
.sj-kicker{font-weight:800;color:var(--brand);font-size:13px;letter-spacing:.07em;text-transform:uppercase}
.sj-features{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
@media (max-width:900px){.sj-features{grid-template-columns:repeat(2,1fr)}}
@media (max-width:560px){.sj-features{grid-template-columns:1fr}}
.sj-feat{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:24px;transition:transform .25s, box-shadow .25s}
.sj-feat:hover{transform:translateY(-4px);box-shadow:var(--shadow)}
.sj-feat-icon{width:50px;height:50px;border-radius:15px;background:linear-gradient(145deg,#e9f6f1,#d3ecdf);color:var(--brand);display:grid;place-items:center;margin-bottom:14px;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}
.sj-feat h3{margin:0 0 6px;font-size:19px}
.sj-feat p{color:var(--muted);font-size:15px}
.sj-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
@media (max-width:760px){.sj-steps{grid-template-columns:1fr}}
.sj-step{border-radius:var(--radius);padding:26px;color:#fff;position:relative;overflow:hidden}
.sj-step:nth-child(1){background:linear-gradient(150deg,#123528,#081a12)}
.sj-step:nth-child(2){background:linear-gradient(150deg,#0d8a66,#065c44)}
.sj-step:nth-child(3){background:linear-gradient(150deg,#24344d,#131c2b)}
.sj-step .sj-snum{font-family:Inter;font-size:15px;font-weight:800;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.22);width:44px;height:44px;border-radius:13px;display:grid;place-items:center}
.sj-step .sj-sic{position:absolute;right:18px;top:22px;opacity:.55}
.sj-step h3{margin:14px 0 6px;font-size:19px}
.sj-step p{color:#d7e2dc;font-size:15px}
.sj-checklist{display:grid;gap:10px;margin-top:16px}
.sj-checklist li{display:flex;gap:10px;align-items:flex-start;font-size:15px}
.sj-checklist .ic{color:var(--brand);margin-top:3px;width:19px;height:19px}
.sj-faq{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:760px){.sj-faq{grid-template-columns:1fr}}
.sj-faq details{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:17px 19px}
.sj-faq summary{font-weight:700;cursor:pointer;min-height:36px;display:flex;align-items:center;list-style:none}
.sj-faq summary::-webkit-details-marker{display:none}
.sj-faq p{color:var(--muted);margin-top:8px;font-size:15px}
.sj-about{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:760px){.sj-about{grid-template-columns:1fr}}
.sj-about-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:26px}
.sj-about-card .sj-aic{width:46px;height:46px;border-radius:13px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;margin-bottom:12px}
.sj-about-card h3{margin:0 0 8px;font-size:19px}
.sj-about-card p{color:var(--muted);font-size:15px}
/* ---------- FOOTER ---------- */
/* 2026-11-28 footer logo raise (Sabbir 09:43): padding-top 48px -> 36px
   so the footer logo sits 12px higher; bottom padding unchanged. */
.sj-foot{border-top:1px solid var(--line);background:var(--surface);padding:36px 0 30px;margin-top:10px}
.sj-foot-grid{display:grid;grid-template-columns:1.55fr .75fr .75fr 1.05fr .8fr;gap:28px}
.sj-foot-grid h4{margin:0 0 13px;font-size:15px}
.sj-foot-grid ul{display:grid;gap:9px}
.sj-foot-grid ul a,.sj-foot-grid li{color:var(--muted);font-size:14.5px}
.sj-foot-grid ul a:hover{color:var(--brand)}
.sj-foot-desc{color:var(--muted);font-size:14.5px;max-width:290px;margin-top:12px}
.sj-foot-contact{display:grid;gap:9px;margin-top:16px}
.sj-foot-contact li{display:flex;gap:9px;align-items:flex-start;color:var(--muted);font-size:14.5px}
.sj-foot-contact .ic{color:var(--brand);margin-top:3px}
.sj-app-btn{display:flex;align-items:center;gap:11px;background:var(--dark);color:#fff;border-radius:14px;padding:11px 14px;transition:transform .2s, box-shadow .2s;box-shadow:0 10px 22px rgba(9,30,22,.22)}
.sj-app-btn:hover{transform:translateY(-2px)}
.sj-app-btn .sj-ab-ic{width:36px;height:36px;border-radius:10px;background:rgba(255,255,255,.13);display:grid;place-items:center;flex:none}
.sj-app-btn b{display:block;font-size:14.5px;line-height:1.25}
.sj-app-btn small{display:block;font-size:11.5px;color:#b9cec2;line-height:1.3}
.sj-ios-soon{display:flex;align-items:center;gap:9px;margin-top:10px;background:var(--surface2);border:1px dashed var(--line);border-radius:14px;padding:11px 14px;font-size:13.5px;font-weight:600;color:var(--muted)}
.sj-ios-soon .sj-soon-pill{margin-left:auto;background:var(--brand-soft);color:var(--brand2);font-size:11px;font-weight:800;padding:4px 9px;border-radius:999px;white-space:nowrap}
.sj-foot-bottom{border-top:1px solid var(--line);margin-top:32px;padding-top:19px;display:flex;justify-content:space-between;align-items:center;gap:10px 22px;flex-wrap:wrap;color:var(--muted);font-size:13.5px}
.sj-foot-bottom a{color:var(--muted);font-weight:600}
.sj-foot-bottom a:hover{color:var(--brand)}
.sj-foot-bottom .sj-fb-mid{display:flex;align-items:center;gap:8px}
/* Footer accordion headers (2026-11-28, Variant B, Sabbir picked
   10:21): on DESKTOP the header button must render exactly like the
   old <h4> — plain bold 15px title, margin-bottom 13px, no chevron,
   no pointer cursor. The accordion behaviour (collapse, chevron,
   13.5px links) lives only inside the max-width:640px block below,
   so desktop is untouched. Focus stays visible for keyboard users. */
.sj-acc-btn{display:block;width:auto;background:none;border:0;padding:0;margin:0 0 13px;font:inherit;font-size:15px;font-weight:700;text-align:left;color:inherit;cursor:default}
.sj-acc-btn .sj-acc-chev{display:none}
.sj-acc-btn:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
/* Mobile footer — its own stacked, card-style arrangement */
@media (max-width:1020px){.sj-foot-grid{grid-template-columns:1fr 1fr}.sj-foot-brand{grid-column:1/-1}}
@media (max-width:640px){
  /* 2026-11-23 header/footer v2 (M3): the old selector was the bare
     `footer` element (0,0,1) — it lost to .sj-foot (0,1,0), so the
     mobile 38px/26px padding + gradient NEVER applied (48px/30px flat
     stayed). Same declarations, scoped selector. */
  /* 2026-11-28 footer logo raise (Sabbir 09:43): padding-top 38px -> 26px,
     logo 12px higher on mobile; gradient + bottom padding unchanged.
     2026-11-28 footer accordion (Variant B, Sabbir picked 10:21):
     26px -> 20px, logo a touch higher still. */
  .sj-foot{padding:20px 0 26px;background:linear-gradient(180deg,var(--surface),var(--surface2))}
  .sj-foot-brand{text-align:center}
  .sj-foot-brand .sj-logo{justify-content:center}
  /* 2026-11-23 header/footer v2 (M4): the description was capped at
     290px inside a 350px brand column at 390px — a narrow stub that
     wrapped mid-phrase and read as "cut off". Full brand width now. */
  .sj-foot-desc{margin:12px auto 0;max-width:100%;text-wrap:balance}
  .sj-foot-contact{justify-items:center}
  .sj-foot-contact li{justify-content:center;text-align:left}
  .sj-foot-app{grid-column:1/-1;order:5;background:linear-gradient(150deg,#0d8a66,#065c44);border-radius:20px;padding:20px;text-align:center;box-shadow:0 16px 32px rgba(6,92,68,.3)}
  .sj-foot-app h4{color:#fff;font-size:16.5px;margin-bottom:5px}
  .sj-foot-app .sj-app-sub{color:#cdeede;font-size:13.5px;margin-bottom:14px;display:block}
  .sj-foot-app .sj-app-btn{background:#fff;color:#0d1f18;box-shadow:0 10px 22px rgba(0,0,0,.2);justify-content:center}
  .sj-foot-app .sj-app-btn .sj-ab-ic{background:var(--brand-soft);color:var(--brand)}
  .sj-foot-app .sj-app-btn small{color:var(--muted)}
  /* 2026-11-23 footer text (D1 follow-up): .sj-landing a.sj-app-btn{color:#fff}
     (0,2,1) beats the plain .sj-foot-app .sj-app-btn rule (0,2,0) above,
     so the white button's <b>Android অ্যাপ</b> inherited white and was
     invisible on the white button (only <small> showed — it has its own
     (0,3,0) muted rule). The .sj-landing prefix lifts this rule to
     (0,3,0) so the footer button is dark ink again; the <b> is pinned
     explicitly too, mirroring the <small> rule. Desktop dark button
     (base .sj-app-btn, white text) untouched. */
  .sj-landing .sj-foot-app .sj-app-btn{color:#0d1f18}
  .sj-foot-app .sj-app-btn b{color:#0d1f18}
  .sj-foot-app .sj-ios-soon{background:rgba(255,255,255,.13);border-color:rgba(255,255,255,.35);color:#eafff5;justify-content:center}
  .sj-foot-app .sj-ios-soon .sj-soon-pill{background:#fff;color:var(--brand2)}
  .sj-foot-col{text-align:left;min-width:0}
  /* 2026-11-28 footer accordion (Sabbir picked Variant B 10:21):
     the 2-column mobile grid is replaced by ONE stacked column — the three sections become
     tappable accordions (rules below), so no column is left half-empty
     and no orphan cell remains. The expanded links use balanced
     column-flow grids (product 4+4, account 1+1, legal 3+2) at 13.5px.
     Measured with uharfbuzz (Noto Sans Bengali Regular — the actual
     Android phone font): longest link "WooCommerce সেটআপ" 139.4px
     @13.5px / 129.1px @12.5px; effective column 169px @390px /
     154px @360px / 134px @320px (16px wrap padding, 12px column gap,
     2px panel padding each side) — every link fits on ONE line with
     ~15px slack @360px and ~5px @320px (13.5px fits down to 323px, so
     links drop to 12.5px only at max-width:320px — the real-viewport
     translation of the approved 320px phone frame). This reverses
     the mobile half of the 2026-11-23 v2 "3 columns in ONE row" call
     and supersedes the 09:37 2-column fix. */
  .sj-foot-grid{grid-template-columns:1fr;gap:0}
  .sj-foot .sj-wrap{padding:0 16px}
  .sj-foot-brand{grid-column:1/-1}
  .sj-foot-grid h4{margin-bottom:11px;font-size:14.5px}
  .sj-foot-grid ul{gap:10px}
  .sj-foot-grid ul a,.sj-foot-grid li{font-size:12.5px;line-height:1.45}
  .sj-foot-grid ul a{white-space:nowrap}
  .sj-foot-legal{grid-column:1/-1}
  .sj-foot-brand{order:1}
  .sj-foot-product{order:2}
  .sj-foot-account{order:3}
  .sj-foot-legal{order:4}
  /* Footer accordion, mobile only (Variant B): the header button is a
     real <button> (keyboard operable, aria-expanded toggled by the
     app.js IIFE). Panels are OPEN by default — the collapse rules only
     apply under html.sj-acc, which app.js adds at boot on mobile
     viewports only (no-JS fail-safe: with JS off, every footer link
     stays visible; on desktop these rules never apply). The 0.35s
     grid-template-rows transition + 180deg chevron rotation are the
     approved values; prefers-reduced-motion already disables
     .sj-foot transitions (rule below). The divider under the brand is
     the hairline div inside .sj-foot-brand; product/account carry the
     1px bottom border, legal has none (the app card's 26px top margin
     is the gap after it — same 26px the old grid row-gap gave). */
  .sj-foot-hairline{height:1px;background:var(--line);margin-top:20px}
  .sj-acc-btn{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;background:none;border:0;padding:15px 2px;margin:0;min-height:52px;text-align:left;cursor:pointer}
  .sj-acc-btn .sj-acc-t{font-size:14.5px;font-weight:700;color:var(--ink)}
  .sj-acc-btn .sj-acc-chev{color:var(--muted);display:flex;flex:none;transition:transform .35s ease}
  .sj-foot-product,.sj-foot-account{border-bottom:1px solid var(--line)}
  .sj-acc-clip{overflow:hidden;min-height:0}
  .sj-acc-pad{padding:4px 2px 18px}
  html.sj-acc .sj-acc-panel{display:grid;grid-template-rows:0fr;transition:grid-template-rows .35s ease}
  html.sj-acc .sj-acc-item.open .sj-acc-panel{grid-template-rows:1fr}
  html.sj-acc .sj-acc-item.open .sj-acc-btn .sj-acc-chev{transform:rotate(180deg)}
  .sj-foot-grid ul.sj-bal-links{display:grid;grid-auto-flow:column;column-gap:12px;row-gap:10px}
  .sj-foot-grid ul.sj-bal-links a{font-size:13.5px;white-space:nowrap}
  .sj-foot-grid ul.sj-rows4{grid-template-rows:repeat(4,auto)}
  .sj-foot-grid ul.sj-rows1{grid-template-rows:repeat(1,auto)}
  .sj-foot-grid ul.sj-rows3{grid-template-rows:repeat(3,auto)}
  .sj-foot-app{margin-top:26px}
  .sj-foot-bottom{flex-direction:column;text-align:center;justify-content:center}
}
/* 2026-11-28 footer accordion (Variant B): at 320px the 13.5px links
   no longer fit — longest link "WooCommerce সেটআপ" is 139.4px @13.5px
   (Noto Sans Bengali Regular, measured with uharfbuzz) against a
   134px effective column (16px wrap padding, 12px column gap, 2px
   panel padding each side), so links drop to 12.5px (129.1px, ~5px
   slack). 13.5px fits down to 323px, so 320px is the exact cutoff.
   This is the real-viewport translation of the approved 320px phone
   frame (which had no width @media). */
@media (max-width:320px){
  .sj-foot-grid ul.sj-bal-links a{font-size:12.5px}
}
@media (min-width:641px){.sj-foot-app .sj-app-sub{display:none}}
/* ---------- SCROLL REVEAL ---------- */
html.sj-js-anim .sj-reveal{opacity:0;transform:translateY(30px);transition:opacity .75s ease,transform .75s cubic-bezier(.22,.61,.36,1);transition-delay:var(--rd,0s)}
html.sj-js-anim .sj-reveal.sj-in{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){
  .sj-landing *, .sj-landing *::before, .sj-landing *::after, .sj-topbar *, .sj-topbar *::before, .sj-topbar *::after, .sj-foot *, .sj-foot *::before, .sj-foot *::after{animation:none!important;transition:none!important}
  html.sj-js-anim .sj-reveal{opacity:1;transform:none}
}
/* ---- Home SaaS public pages (2026-11-23, approved v12 design) ---- */
/* Page wrapper: SaaS theme, LIGHT only (dark mode was cancelled 2026-11-19).
   Every sj- rule above is .sj-* prefixed, so nothing here touches the
   tenant/admin panels. The --bg/--brand vars are scoped to the sj roots
   (see the vars block at the top of the conversion). */
.sj-landing{ background:var(--bg); color:var(--ink); font-family:"Hind Siliguri",Inter,system-ui,sans-serif; line-height:1.6; overflow-x:clip; }
.sj-topbar.scrolled{ box-shadow:0 10px 28px rgba(9,30,22,.10); }
/* Pricing page (/pricing): 3 live plan cards. The surface box is
   GONE since the 2026-11-27 home-design build (Sabbir-approved
   16:51, approved /pricing design) — .sj-pricing below is
   just the unboxed section wrapper now, same as home's
   .sj-home-pricing; the grid + card rules live in the /pricing
   block right after the mobile pricing block. */
.sj-pricing{background:none;border:0;border-radius:0;padding:0;box-shadow:none;display:block}
.sj-price-box{background:var(--brand-soft);border-radius:20px;padding:26px;text-align:center}
.sj-price{font-family:Inter;font-size:50px;font-weight:800;line-height:1}
.sj-price small{font-family:"Hind Siliguri";font-size:17px;color:var(--muted);font-weight:600}
.sj-price-box .sj-btn .ic{width:17px;height:17px}
@media (max-width:760px){.sj-pricing{grid-template-columns:1fr}}
/* /pricing = home design (2026-11-27, Sabbir-approved 16:51,
   approved /pricing design): the same centered 3-col
   layout as home, scoped to .sj-pricing (used ONLY by
   views/pricing.ejs) — the surface box is gone, the grid is capped
   at 1020px and centered, the header uses the .sj-sec-head pattern
   with /pricing's OWN copy (checklist item 2 stays "AI অটো-রিপ্লাই
   + ইউনিফাইড ইনবক্স" — the identical-copy option was NOT chosen).
   ORDER IS LOAD-BEARING (billing width-order fix, ee569951): the
   base grid rule comes BEFORE the breakpoint rules — same
   specificity, later wins — and this whole block sits BEFORE the
   max-width:639px strip block below, so the strip rules (same
   specificity, later) still win below 640px. The featured card is
   the grid's first child (plans render price ASC, so the cheapest /
   entry plan is first) — no markup class needed, and no plan code
   is hardcoded. NOTE: the max-width:760px rule above is inert now
   (display:block) — left in place, harmless. */
.sj-pricing .sj-sec-head{margin-bottom:0}
.sj-pricing .sj-kicker{display:inline-block;background:var(--brand-soft);color:var(--brand2);font-weight:700;font-size:13.5px;letter-spacing:.02em;padding:6px 14px;border-radius:999px;line-height:1.3}
.sj-pricing .sj-checklist{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:10px 26px;margin:22px 0 0;padding:0;list-style:none}
.sj-pricing .sj-checklist li{display:flex;align-items:center;gap:8px;font-size:14.5px;font-weight:600;color:var(--ink);white-space:nowrap}
.sj-pricing .sj-checklist .ic{width:20px;height:20px;margin-top:0;color:var(--brand)}
.sj-pricing .pricing-grid{max-width:1020px;margin:38px auto 0;display:grid;grid-template-columns:1fr;gap:20px;align-items:stretch}
.sj-pricing .price-card{position:relative;overflow:hidden;background:#fff;border:1px solid #dce7e1;border-radius:20px;padding:32px 28px 28px;margin-bottom:0;box-shadow:0 6px 22px rgba(13,31,24,.06);display:flex;flex-direction:column}
.sj-pricing .price-card::before{content:'';position:absolute;top:0;left:0;right:0;height:4px;background:#d1d5db}
.sj-pricing .price-card:first-child{border:2px solid #10b981;background:linear-gradient(180deg,rgba(16,185,129,.08) 0,#fff 46%)}
.sj-pricing .price-card:first-child::before{background:linear-gradient(90deg,#10b981,#34d399)}
.sj-pricing .price-card h3{display:flex;align-items:center;gap:9px;flex-wrap:wrap;font-size:18px;font-weight:700;line-height:1.35}
.sj-pricing .price-card .pill{font-size:12px;font-weight:700;line-height:1.3;color:#54665d;background:#eef2f0;border:1px solid #dce7e1;padding:4px 9px}
.sj-pricing .amount{display:flex;align-items:baseline;gap:5px;flex-wrap:wrap;margin:14px 0 0;font-size:32px;font-weight:800;line-height:1.1;letter-spacing:-.01em}
.sj-pricing .amount small{font-size:14.5px;font-weight:500;color:var(--muted)}
.sj-pricing .price-card .price-features{display:grid;gap:10px;margin:20px 0 28px}
.sj-pricing .price-card .price-features li{display:flex;align-items:center;gap:8px;font-size:15px;line-height:1.45;white-space:nowrap;overflow:hidden}
.sj-pricing .price-card .price-features li .ic{width:18px;height:18px;margin-top:0;color:var(--brand)}
.sj-pricing .price-card .sj-btn{margin-top:auto}
.sj-pricing .price-card .muted.small{margin:auto 0 0;padding-top:6px;font-size:13.5px;line-height:1.65}
.sj-pricing .pricing-grid .price-card ul li:hover{transform:none;background:none}
.sj-pricing .pricing-grid .price-card .amount{transition:none}
.sj-pricing .pricing-grid .price-card:hover .amount{transform:none}
.sj-pricing .pricing-grid .price-card:hover{border-color:#dce7e1}
.sj-pricing .pricing-grid .price-card:first-child:hover{border-color:#10b981}
@media (min-width: 640px) and (max-width: 899px){.sj-pricing .pricing-grid{grid-template-columns:repeat(2,1fr)}}
@media (min-width: 900px){.sj-pricing .pricing-grid{grid-template-columns:repeat(3,1fr)}}
@media (hover:hover) and (min-width: 900px){.sj-pricing .pricing-grid .price-card:hover{transform:translateY(-4px);box-shadow:0 16px 34px rgba(13,31,24,.13)}}
/* Home pricing redesign (2026-11-27, Sabbir-approved 2026-11-27 14:59,
   HOME-ONLY): the shared .pricing-grid
   is 4 columns at >=1280px with only 3 cards, so the home cards sat
   left-aligned with a dead 4th column. These .sj-home-pricing-scoped
   rules center the home section only — /pricing got the SAME
   design on 2026-11-27 (Sabbir-approved 16:51, approved
   /pricing design), scoped to .sj-pricing in the
   block above. ORDER IS LOAD-BEARING (billing width-order fix,
   ee569951): the base grid rule comes BEFORE the breakpoint rules —
   same specificity, later wins. The featured card is the grid's first
   child (plans render price ASC, so the cheapest / entry plan is
   first) — no markup class needed, and no plan code is hardcoded. */
.sj-home-pricing .sj-sec-head{margin-bottom:0}
.sj-home-pricing .sj-kicker{display:inline-block;background:var(--brand-soft);color:var(--brand2);font-weight:700;font-size:13.5px;letter-spacing:.02em;padding:6px 14px;border-radius:999px;line-height:1.3}
.sj-home-pricing .sj-checklist{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:10px 26px;margin:22px 0 0;padding:0;list-style:none}
.sj-home-pricing .sj-checklist li{display:flex;align-items:center;gap:8px;font-size:14.5px;font-weight:600;color:var(--ink);white-space:nowrap}
.sj-home-pricing .sj-checklist .ic{width:20px;height:20px;margin-top:0;color:var(--brand)}
.sj-home-pricing .pricing-grid{max-width:1020px;margin:38px auto 0;display:grid;grid-template-columns:1fr;gap:20px;align-items:stretch}
.sj-home-pricing .price-card{position:relative;overflow:hidden;background:#fff;border:1px solid #dce7e1;border-radius:20px;padding:32px 28px 28px;margin-bottom:0;box-shadow:0 6px 22px rgba(13,31,24,.06);display:flex;flex-direction:column}
.sj-home-pricing .price-card::before{content:'';position:absolute;top:0;left:0;right:0;height:4px;background:#d1d5db}
.sj-home-pricing .price-card:first-child{border:2px solid #10b981;background:linear-gradient(180deg,rgba(16,185,129,.08) 0,#fff 46%)}
.sj-home-pricing .price-card:first-child::before{background:linear-gradient(90deg,#10b981,#34d399)}
.sj-home-pricing .price-card h3{display:flex;align-items:center;gap:9px;flex-wrap:wrap;font-size:18px;font-weight:700;line-height:1.35}
.sj-home-pricing .price-card .pill{font-size:12px;font-weight:700;line-height:1.3;color:#54665d;background:#eef2f0;border:1px solid #dce7e1;padding:4px 9px}
.sj-home-pricing .amount{display:flex;align-items:baseline;gap:5px;flex-wrap:wrap;margin:14px 0 0;font-size:32px;font-weight:800;line-height:1.1;letter-spacing:-.01em}
.sj-home-pricing .amount small{font-size:14.5px;font-weight:500;color:var(--muted)}
.sj-home-pricing .price-card .price-features{display:grid;gap:10px;margin:20px 0 28px}
.sj-home-pricing .price-card .price-features li{display:flex;align-items:center;gap:8px;font-size:15px;line-height:1.45;white-space:nowrap;overflow:hidden}
.sj-home-pricing .price-card .price-features li .ic{width:18px;height:18px;margin-top:0;color:var(--brand)}
.sj-home-pricing .price-card .sj-btn{margin-top:auto}
.sj-home-pricing .price-card .muted.small{margin:auto 0 0;padding-top:6px;font-size:13.5px;line-height:1.65}
.sj-home-pricing .pricing-grid .price-card ul li:hover{transform:none;background:none}
.sj-home-pricing .pricing-grid .price-card .amount{transition:none}
.sj-home-pricing .pricing-grid .price-card:hover .amount{transform:none}
.sj-home-pricing .pricing-grid .price-card:hover{border-color:#dce7e1}
.sj-home-pricing .pricing-grid .price-card:first-child:hover{border-color:#10b981}
@media (min-width: 640px) and (max-width: 899px){.sj-home-pricing .pricing-grid{grid-template-columns:repeat(2,1fr)}}
@media (min-width: 900px){.sj-home-pricing .pricing-grid{grid-template-columns:repeat(3,1fr)}}
@media (hover:hover) and (min-width: 900px){.sj-home-pricing .pricing-grid .price-card:hover{transform:translateY(-4px);box-shadow:0 16px 34px rgba(13,31,24,.13)}}
@media (max-width: 639px){
  .sj-home-pricing .sj-checklist{flex-direction:column;flex-wrap:nowrap;gap:10px}
  .sj-home-pricing .sj-checklist li{white-space:normal;text-align:left}
  .sj-pricing .sj-checklist{flex-direction:column;flex-wrap:nowrap;gap:10px}
  .sj-pricing .sj-checklist li{white-space:normal;text-align:left}
  /* Home pricing mobile strip (2026-11-27, Sabbir's order 15:59):
     below 640px the cards scroll sideways instead of stacking —
     same strip pattern as the billing plan cards (commit ee569951):
     flex row, scroll-snap, 72% cards (one full card + a peek of
     the next), hidden scrollbar, end fade removed by .at-end from
     the scroll listener in public/js/landing.js. 640px and up keep
     the 2-col / 3-col centered grids above. ORDER: this block sits
     after the base grid rule, so it wins below 640px. */
  .sj-home-pricing .pricing-grid{margin-top:30px;display:flex;overflow-x:auto;scroll-snap-type:x mandatory;align-items:stretch;scrollbar-width:none;-webkit-mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 32px),transparent 100%);mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 32px),transparent 100%);overscroll-behavior-x:contain;padding-bottom:4px}
  .sj-home-pricing .pricing-grid::-webkit-scrollbar{display:none}
  .sj-home-pricing .pricing-grid.at-end{-webkit-mask-image:none;mask-image:none}
  .sj-home-pricing .pricing-grid .price-card{flex:0 0 72%;scroll-snap-align:start;min-width:0}
  /* /pricing mobile strip (2026-11-27, Sabbir's order 16:15):
     below 640px the /pricing cards scroll sideways instead of
     stacking — same strip pattern as the home + billing plan
     cards: flex row, scroll-snap, 72% cards (one full card + a
     peek of the next), hidden scrollbar, end fade removed by
     .at-end from the scroll listener in public/js/landing.js.
     Scoped to .sj-pricing (used ONLY by views/pricing.ejs) so
     it cannot leak into the home strip or the billing strip.
     Desktop uses the .sj-pricing 3-col centered grid (block
     above, 2026-11-27 home design) — the shared 4-col rule still
     exists but loses by specificity; this block only applies
     below 640px, and the shared base grid rule (line 787)
     precedes it. */
  .sj-pricing .pricing-grid{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;align-items:stretch;scrollbar-width:none;-webkit-mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 32px),transparent 100%);mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 32px),transparent 100%);overscroll-behavior-x:contain;padding-bottom:4px}
  .sj-pricing .pricing-grid::-webkit-scrollbar{display:none}
  .sj-pricing .pricing-grid.at-end{-webkit-mask-image:none;mask-image:none}
  .sj-pricing .pricing-grid .price-card{flex:0 0 72%;scroll-snap-align:start;min-width:0}
  /* Pricing card CTA: one line on mobile (2026-11-28, Sabbir's
     screenshot 09:01 — "ফ্রি ট্রায়াল শুরু করুন" wrapped to 2 lines
     in the 72% strip card). Measured with uharfbuzz, Hind Siliguri
     Bold: "ফ্রি ট্রায়াল শুরু করুন" = 113.5px at 14px (129.7px at
     16px); "অ্যাকাউন্ট খুলুন" = 89.0px at 14px. Button space: 360px
     viewport -> card 230.4px, content 190.4px after the 20px card
     padding, text space 190.4 - 2*16px padding = 158.4px; 320px
     viewport -> 129.6px. Both fit 113.5px with slack. Arrow hidden
     on mobile (same as the topbar CTA, which hides its arrow at
     <=820px). Desktop unchanged (16px + arrow + 24px padding). */
  .sj-home-pricing .price-card, .sj-pricing .price-card{padding:32px 20px 28px}
  .sj-home-pricing .price-card .sj-btn, .sj-pricing .price-card .sj-btn{white-space:nowrap;font-size:14px;padding:13px 16px}
  .sj-home-pricing .price-card .sj-btn .ic, .sj-pricing .price-card .sj-btn .ic{display:none}
}
@media (prefers-reduced-motion: reduce){.sj-home-pricing .price-card{transition:none}.sj-home-pricing .pricing-grid .price-card:hover{transform:none}.sj-pricing .price-card{transition:none}.sj-pricing .pricing-grid .price-card:hover{transform:none}}
/* Mobile menu (the approved design hid the nav links with no menu — production fix). */
.sj-mnav{ display:none; }
.sj-mnav summary{ list-style:none; cursor:pointer; padding:8px; color:var(--muted); }
.sj-mnav summary::-webkit-details-marker{ display:none; }
.sj-mnav .sj-mnav-links{ position:absolute; left:0; right:0; top:100%; background:var(--surface); border-bottom:1px solid var(--line); padding:8px 20px 16px; display:flex; flex-direction:column; gap:2px; box-shadow:0 18px 38px rgba(9,30,22,.10); }
.sj-mnav .sj-mnav-links a{ padding:10px 4px; border-bottom:1px solid var(--line); color:var(--muted); font-weight:600; }
.sj-mnav .sj-mnav-links a:last-child{ border-bottom:0; }
@media (max-width:820px){ .sj-mnav{ display:block; } .sj-nav{ gap:10px; } .sj-nav-cta .sj-btn-ghost{ display:none; } /* 2026-11-23 header/footer v2 (M5): at 390px the header fit by ~3px (logo ~123px + CTA ~162px + hamburger ~42px + gaps ~20px vs 350px) and broke below ~380px. Smaller wordmark + tighter CTA padding buys ~14px slack. Scoped to the topbar so the footer wordmark keeps 24px. */ .sj-topbar .sj-logo{ font-size:20px; } .sj-nav-cta .sj-btn{ padding:10px 12px; font-size:14px; } /* M7 (2026-11-23): the CTA sat CENTERED on mobile — with 3 visible flex children (logo | CTA | hamburger) space-between splits the free space into the two gaps, so the pill floats mid-row (the approved design has no hamburger, so its CTA sits flush right). margin-left:auto absorbs the free space: logo left, CTA + hamburger grouped right. The decorative arrow in the topbar CTA is hidden at <=820px (~24px slack) so the right-aligned group still fits a 360px viewport; the hero CTA keeps its arrow. */ .sj-nav-cta{ margin-left:auto; } .sj-topbar .sj-nav-cta .sj-btn-primary .ic{ display:none; } }
/* About / contact pages: plain H1 (legal-page pattern — no header card,
   no icon, no description line) + breadcrumb + centred intro. */
.sj-crumb{ font-size:13.5px; color:var(--muted); font-weight:600; margin:0 0 14px; }
.sj-crumb a{ color:var(--brand); font-weight:700; }
.sj-page-head{ max-width:720px; margin:0 auto 30px; text-align:center; }
.sj-page-head h1{ margin:10px 0 10px; }
.sj-page-head p{ color:var(--muted); font-size:16.5px; }
/* Features page (2026-11-23) */
/* Home "সব ফিচার দেখুন" CTA + /features page. Scoped .sj-featpage-* /
   .sj-feat-cta rules only; no existing rule is edited. Reuses
   .sj-features / .sj-feat / .sj-sec-head. */
.sj-feat-cta{margin-top:26px;text-align:center}
/* 2026-11-23: group headings are cards now — as bare text they merged
   visually with the feature cards below, so each heading gets its own
   soft-green card (theme tint + brand border) with clear space above
   and below. Same card for all 7 groups; no feature card changes. */
.sj-featpage-group{margin:40px 0 18px;padding:14px 18px;font-size:clamp(22px,2.8vw,28px);text-align:center;color:var(--brand2);background:var(--brand-soft);border:1px solid rgba(10,122,92,.18);border-radius:14px;box-shadow:0 1px 3px rgba(13,31,24,.06)}
.sj-featpage-row{padding:20px}
.sj-featpage-row .sj-feat-icon{width:44px;height:44px;border-radius:13px;margin-bottom:12px}
.sj-featpage-row h3{font-size:17px}
.sj-featpage-row p{font-size:14.5px}
@media (max-width:640px){.sj-featpage-group{margin-top:28px}.sj-landing .sj-featpage{padding-top:28px}}
/* ---- Home header/footer v2 (2026-11-23, Sabbir's voice-call order) ---- */
/* M2: the global `body { padding-bottom: calc(64px + ...) }` (room for the
   tenant bottom nav) left ~64px+ dead space below the footer on phones —
   the only override was the desktop min-width:900px block. Public pages
   carry body class `landing` (partials/head.ejs) and have NO bottomnav
   markup, so the room is cancelled page-scoped. Tenant panel untouched
   (its body has no `landing` class). Specificity (0,1,1) beats body
   (0,0,1) at any position, so this lives at the tail, not mid-file. */
body.landing{padding-bottom:0}
/* M6: "Developed by Prifix IT" — the <strong> inherited muted grey from
   .sj-foot-bottom; the approved design inks it. Old effective: muted -> new: ink. */
.sj-foot-bottom strong{color:var(--ink)}
/* /features page, mobile 2-column grid (Sabbir's order 2026-11-23): the
   shared .sj-features rule is 1fr at <=560px and the HOME page must stay
   1-column, so this is scoped to .sj-featpage (the /features <section>
   class, views/features.ejs). At 390px the content box is 350px, so two
   cards are ~167px each with a 16px gap — compact padding/icon/type so
   nothing overflows or cuts. 2026-11-23 card separation: the 12px gap +
   hairline #dce7e1 border read as one white mass on the pale page, so
   cards get a 16px gap and a stronger border (no layout change — the
   border stays 1px, no new rule). Desktop (3 cols) unchanged. */
@media (max-width:560px){
  .sj-featpage .sj-features{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  .sj-featpage .sj-feat{min-width:0;overflow-wrap:break-word;padding:16px 14px;border-color:rgba(13,31,24,.14)}
  .sj-featpage .sj-feat-icon{width:40px;height:40px;border-radius:12px;margin-bottom:10px}
  .sj-featpage .sj-feat h3{font-size:15px}
  .sj-featpage .sj-feat p{font-size:13.5px}
}
/* ---- Desktop hero phone text fix (2026-11-24, Sabbir's voice-call order):
   at 220px the header name "কাস্টমার (উদাহরণ)" wrapped to two lines and
   the input placeholder wrapped too. One line + ellipsis; the icons keep
   their place. Scoped to min-width:981px — the mobile stacked phone
   (max-width:980px, min(262px,74vw)) is untouched, and size/position/
   animation are unchanged. The placeholder text is a <span class=
   "sj-input-text"> in landing.ejs (a bare text node cannot be ellipsised). */
@media (min-width:981px){
  .sj-phone-head>div:not(.sj-avatar){flex:1;min-width:0}
  .sj-phone-head .sj-pname{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sj-phone-head .sj-pstat{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sj-input-box{min-width:0}
  .sj-input-box .sj-input-text{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sj-input-box .ic{flex:none}
  .sj-input-box>span:not(.sj-input-text){flex:none}
}
/* ---- FAQ design (2026-11-24, Sabbir's order: 4 -> 12 questions):
   chevron per question (rotates when open), open card light-green tint,
   comfortable answer line-height. Applies to both the home strip and
   the /faq page (both use .sj-faq + .faq-item). The rotation itself is
   already covered by the older .faq-item rules (style.css:813-814);
   the rule below keeps it true inside the scoped .sj-faq block too. */
.sj-faq summary{gap:12px}
.sj-faq summary::-webkit-details-marker{display:none}
.sj-faq summary .ic{margin-left:auto;flex:none}
.sj-faq details[open] summary .ic{transform:rotate(180deg)}
.sj-faq details[open]{background:var(--brand-soft);border-color:rgba(10,122,92,.35)}
.sj-faq details p{line-height:1.75}
/* ---- FAQ strip, 2 cards per viewport (2026-11-25, Sabbir's call:
   exactly 2 cards visible + horizontal scroll on BOTH desktop and
   mobile, home strip AND the /faq page). Scoped to #faq .sj-faq: the
   home section and the /faq page section both carry id="faq". Card
   width calc((100% - 14px) / 2) = exactly half the strip minus half
   the gap, so exactly 2 cards fill the viewport at any width — the
   old 320px / 85vw fixed widths showed a fractional count (desktop
   ~3.5, mobile ~1.2). Pattern from .order-filter-strip: hidden
   scrollbar + right-edge mask fade + drag-to-scroll (landing.js). */
#faq .sj-faq-strip-wrap{display:flex;align-items:center;gap:12px}
#faq .sj-faq{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;align-items:flex-start;gap:14px;scrollbar-width:none;-webkit-mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 32px),transparent 100%);mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 32px),transparent 100%);overscroll-behavior-x:contain}
#faq .sj-faq::-webkit-scrollbar{display:none}
#faq .sj-faq.at-end{-webkit-mask-image:none;mask-image:none}
#faq .sj-faq details{flex:0 0 calc((100% - 14px) / 2);scroll-snap-align:start;min-width:0}
/* ---- Home FAQ strip arrows: desktop only, hidden <=760px (mobile swipes). */
.sj-faq-arrow{flex:none;width:38px;height:38px;border-radius:50%;border:1px solid var(--line);background:var(--surface);color:var(--ink);display:grid;place-items:center;cursor:pointer;box-shadow:var(--shadow)}
.sj-faq-arrow:hover{border-color:rgba(10,122,92,.45);color:var(--brand)}
.sj-faq-arrow[disabled]{opacity:.35;cursor:default}
@media (max-width:760px){
  #faq .sj-faq-strip-wrap{gap:0}
  .sj-faq-arrow{display:none}
  /* FAQ: one wide card + peek on mobile (2026-11-28, Sabbir's
     screenshot 09:02 — 2-per-viewport cards broke questions into
     4 narrow lines; longest question 289.4px at 15px bold needs the
     204px/170px summary space an 85% card gives). Strip/snap/drag
     stay; desktop keeps exactly 2 per viewport. */
  #faq .sj-faq details{flex:0 0 85%}
}
/* ---- Home FAQ equal heights (Phase 2, 2026-11-24) ----
   His report: question text wraps to two lines on some cards, so
   closed cards were unequal sizes. The summary inherits body 15px /
   line-height 1.6 = 24px per line; the old min-height:36px (1.5 lines)
   let 1-line questions sit at 36px while 2-line questions grew to
   48px. A uniform TWO-LINE min-height (2 x 24px = 48px) makes every
   closed card exactly equal (same padding + same summary height, no
   answer shown). No font-size change, no truncation, no ellipsis —
   every word stays visible. align-items:flex-start on the strip is
   untouched: opening one card still does not stretch the others.
   Shared with the /faq strip (same .sj-faq summary rule) — intended. */
.sj-faq summary{min-height:48px}

/* Inbox redesign 2026-12-05: tokens scoped under .page.inbox-page so no
   other page is touched. Breakpoints 560 / 640 / 820 / 1240 (not the app
   shell's 900px). Layout: <820 single pane, >=820 two-pane (348px list),
   >=1240 three-pane (372px list + 330px panel). */
.page.inbox-page {
  --ib-bg: #e8edea;
  --ib-panel: #fff;
  --ib-panel-2: #f4f7f5;
  --ib-ink: #15211c;
  --ib-ink-2: #43554d;
  --ib-muted: #71837a;
  --ib-line: #dde5e0;
  --ib-accent: #0b7a5c;
  --ib-accent-deep: #075c44;
  --ib-accent-soft: #e2f3ec;
  --ib-bubble-out: #d8f3e3;
  --ib-bubble-in: #fff;
  --ib-chat-bg: #e6ebe7;
  --ib-amber: #a86e0c;
  --ib-amber-soft: #fdf1d7;
  --ib-red: #c0392b;
  --ib-blue-tick: #2ea6d6;
  background: var(--ib-bg);
  max-width: none;
}
.page.inbox-page [hidden] { display: none !important; }

.inbox-grid { display: grid; grid-template-columns: 1fr; gap: 14px; max-width: 1720px; margin: 0 auto; align-items: stretch; }

/* --- conversation list --- */
.conv-list { padding: 0; scrollbar-width: none; -ms-overflow-style: none; overflow-x: hidden; }
.conv-list.card { overflow-x: hidden; }
.conv-list::-webkit-scrollbar { display: none; }
.conv-list-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 4px; }
.conv-list-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ib-accent-soft); color: var(--ib-accent-deep);
  font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 3px 10px;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ib-accent); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 50% { opacity: .35; } }
.conv-total-badge { margin-left: auto; color: var(--ib-muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }

/* Search + filter chips (live inside the list card now). */
.fsearch-top {
  display: flex; align-items: center; gap: 7px;
  background: var(--ib-panel-2); border: 1px solid var(--ib-line);
  border-radius: 12px; padding: 5px 8px 5px 6px; margin: 10px 12px 8px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.fsearch-top:hover { border-color: var(--brand-line); }
.fsearch-top:focus-within { border-color: var(--ib-accent); box-shadow: 0 0 0 3px var(--ib-accent-soft); background: var(--ib-panel); }
.fsearch-icon {
  color: var(--ib-muted); display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 28px; height: 28px;
  background: var(--ib-panel); border: 1px solid var(--ib-line); border-radius: 10px;
  transition: all .15s ease;
}
.fsearch-top:focus-within .fsearch-icon { color: var(--ib-accent-deep); border-color: var(--ib-accent); background: var(--ib-accent-soft); }
.fsearch-top input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font: inherit; font-size: .85rem; outline: none; padding: 3px 0; color: var(--ib-ink);
}
.fsearch-top input::placeholder { color: var(--ib-muted); }
.fsearch-clear {
  color: var(--ib-muted); font-size: .8rem; flex-shrink: 0;
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--ib-line);
  transition: all .15s ease;
}
.fsearch-clear:hover { text-decoration: none; color: #fff; background: var(--ib-muted); }
.filter-row { padding: 0 12px 10px; }
.ftabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ftab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--ib-line);
  color: var(--ib-ink-2); font-size: .85rem; font-weight: 600; background: var(--ib-panel-2);
  transition: all .15s ease; white-space: nowrap;
}
.ftab:hover { text-decoration: none; border-color: var(--ib-accent); color: var(--ib-accent-deep); }
.ftab.on { background: var(--ib-accent); border-color: var(--ib-accent); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.ftab.on .count-pill { background: rgba(255,255,255,.25); color: #fff; }
.count-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: rgba(0,0,0,.08); color: inherit; font-size: .7rem; font-weight: 700;
}
.chan-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chan-dot.wa { background: #1faa55; }
.chan-dot.ms { background: #0084ff; }

/* Conversation rows. */
.conv {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; min-width: 0; max-width: 100%; overflow: hidden;
  color: var(--ib-ink); border-bottom: 1px solid var(--ib-line); position: relative;
  border-radius: 0; /* beats the old row radius so rows are full-width list items */
}
.conv:hover { background: var(--ib-panel-2); text-decoration: none; }
.conv.on { background: var(--ib-accent-soft); }
.conv.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ib-accent); }
.conv .avatar { flex-shrink: 0; width: 48px; height: 48px; font-size: 1rem; }
.conv-body { min-width: 0; flex: 1; overflow: hidden; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.conv-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 600; min-width: 0; flex: 1; }
.conv-time { flex-shrink: 0; font-size: .75rem; }
.conv-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.conv-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; min-width: 0; flex: 1; }
.unread-badge {
  flex-shrink: 0; min-width: 21px; height: 21px; padding: 0 6px;
  border-radius: 999px; background: #1faa55; color: #fff;
  font-size: .72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.conv.unread .conv-top strong { font-weight: 700; }
.conv.unread .conv-time { color: var(--ib-accent-deep); font-weight: 700; }
.conv.unread .conv-preview { color: var(--ib-ink); font-weight: 600; }
.chan-ic {
  flex-shrink: 0; font-size: .62rem; font-weight: 700; color: #fff;
  background: var(--ib-muted); border-radius: 6px; padding: 2px 5px;
  border: 0; align-self: center; /* beats the old bordered chip */
}
.chan-ic.wa { background: #1faa55; }
.chan-ic.ms { background: #0084ff; }
.conv-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.meta-chip { font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.meta-chip.ai-chip { background: var(--ib-amber-soft); color: var(--ib-amber); }
.meta-chip.tag-chip { background: #eef2f1; color: var(--ib-ink-2); }
.meta-chip.assign-chip { background: #eef2f1; color: var(--ib-ink-2); }
.conv-loader { text-align: center; padding: 12px; color: var(--ib-muted); font-size: .85rem; }
.conv-list-foot { display: flex; justify-content: space-between; gap: 8px; padding: 10px 16px 14px; font-size: .8rem; }
.conv-list .empty { padding: 24px 16px; }

/* Avatar palette — deterministic by conversation id % 12. */
.avatar.av-0 { background: #0b7a5c; color: #fff; border-color: transparent; }
.avatar.av-1 { background: #2563eb; color: #fff; border-color: transparent; }
.avatar.av-2 { background: #9333ea; color: #fff; border-color: transparent; }
.avatar.av-3 { background: #db2777; color: #fff; border-color: transparent; }
.avatar.av-4 { background: #ea580c; color: #fff; border-color: transparent; }
.avatar.av-5 { background: #a16207; color: #fff; border-color: transparent; }
.avatar.av-6 { background: #0891b2; color: #fff; border-color: transparent; }
.avatar.av-7 { background: #4f46e5; color: #fff; border-color: transparent; }
.avatar.av-8 { background: #16a34a; color: #fff; border-color: transparent; }
.avatar.av-9 { background: #dc2626; color: #fff; border-color: transparent; }
.avatar.av-10 { background: #7c3aed; color: #fff; border-color: transparent; }
.avatar.av-11 { background: #0e7490; color: #fff; border-color: transparent; }
.avatar.lg { width: 76px; height: 76px; font-size: 1.5rem; }

/* --- thread --- */
.thread { display: none; flex-direction: column; min-height: 60vh; position: relative; }
body.thread-open .thread { display: flex; }
body.thread-open .conv-list { display: none; }
.thread-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 0; /* beats the old 8px margin */
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.thread-head .avatar { width: 44px; height: 44px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ib-ink); flex-shrink: 0; }
.back-link:hover { text-decoration: none; color: var(--ib-accent-deep); }
.th-id { min-width: 0; flex: 1; }
.th-id strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; font-weight: 700; }
.th-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.th-sub { font-size: .78rem; color: var(--ib-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.thread-actions select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: .85rem; max-width: 170px; min-height: 2.25rem; }
.assign-select { display: none; }
.ai-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; }
.ai-spark { color: var(--ib-amber); display: inline-flex; }
.ai-label { font-size: .8rem; font-weight: 700; color: var(--ib-ink-2); }
.ai-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ai-track { width: 44px; height: 25px; border-radius: 999px; background: #cbd5d1; position: relative; transition: background .2s ease; flex-shrink: 0; }
.ai-knob { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.ai-switch input:checked + .ai-track { background: var(--ib-accent); }
.ai-switch input:checked + .ai-track .ai-knob { transform: translateX(19px); }
.ai-switch input:focus-visible + .ai-track { outline: 2px solid var(--ib-accent); outline-offset: 2px; }
.th-menu { position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; z-index: 30; min-width: 200px; }
.th-menu .btn-block { width: 100%; margin-bottom: 0; /* beats the old 8px margin */ }

/* 24h window bar (hidden when >6h left). */
.window-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 14px 0; padding: 8px 12px; border-radius: 10px;
  background: var(--ib-amber-soft); color: #7c5410; font-size: .85rem;
}
.window-bar.closed { background: #fdeceb; color: #8f1d13; }

/* Messages. */
.messages { display: flex; flex-direction: column; gap: 10px; padding: 22px 8%; overflow-y: auto; flex: 1; background: var(--ib-chat-bg); border-radius: 12px; scrollbar-width: none; -ms-overflow-style: none; }
.messages::-webkit-scrollbar { display: none; }
.day-sep { display: flex; justify-content: center; margin: 6px 0 2px; }
.day-sep span {
  background: #fff; border: 0; color: var(--ib-muted);
  font-size: .75rem; font-weight: 600; padding: 4px 14px; border-radius: 999px;
  box-shadow: 0 1px 1.5px rgba(0,0,0,.09);
}
.msg { max-width: 78%; display: flex; flex-direction: column; }
.msg.in { align-self: flex-start; }
.msg.out-ai, .msg.out-human { align-self: flex-end; align-items: flex-end; }
.bubble {
  padding: 8px 11px 6px;
  border-radius: 14px;
  font-size: .95rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  background: var(--ib-bubble-in); border: 0; /* beats the old 1px border */
  box-shadow: 0 1px 1.5px rgba(0,0,0,.09);
}
.msg.in .bubble { border-top-left-radius: 4px; }
.msg.out-ai .bubble, .msg.out-human .bubble { background: var(--ib-bubble-out); border-top-right-radius: 4px; color: var(--ib-ink); box-shadow: 0 1px 1.5px rgba(0,0,0,.09); /* color beats the old white outgoing text */ }
.bubble-media-only { padding: 2px 4px 0; background: transparent; box-shadow: none; }
.msg small { margin-top: 3px; font-size: .72rem; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-top: 3px; }
.msg-time { font-size: .68rem; color: var(--ib-muted); white-space: nowrap; margin-left: 0; /* beats the old 8px margin */ }
.msg.out-ai .msg-time, .msg.out-human .msg-time { color: #55705f; }
.ticks { font-size: .72rem; color: var(--ib-muted); letter-spacing: -2px; line-height: 1; white-space: nowrap; }
.ticks.read { color: var(--ib-blue-tick); }
.ticks.failed { color: var(--ib-red); letter-spacing: 0; }
.bubble .ai-tag { display: block; color: var(--ib-amber); font-weight: 700; font-size: .68rem; margin-bottom: 2px; }

/* Voice bubble (real <audio>; bars are decorative). */
.voice-bubble {
  display: flex; align-items: center; gap: 10px; min-width: 170px;
  padding: 8px 12px; border-radius: 14px; margin-bottom: 4px;
  background: var(--ib-bubble-in); box-shadow: 0 1px 1.5px rgba(0,0,0,.09);
}
.msg.in .voice-bubble { border-top-left-radius: 4px; }
.msg.out-ai .voice-bubble, .msg.out-human .voice-bubble { background: var(--ib-bubble-out); border-top-right-radius: 4px; }
.voice-play {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
  background: var(--ib-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem;
}
.voice-play.playing { background: var(--ib-accent-deep); }
.voice-bars { display: flex; align-items: center; gap: 2px; height: 28px; flex: 1; min-width: 0; }
.voice-bars i { width: 3px; background: #9db3a8; border-radius: 2px; height: 10px; }
.voice-bars i:nth-child(2n) { height: 16px; }
.voice-bars i:nth-child(3n) { height: 22px; }
.voice-bars i:nth-child(5n) { height: 8px; }
.voice-dur { font-size: .72rem; color: var(--ib-muted); flex-shrink: 0; }

/* File card. */
.msg .file-card {
  display: flex; gap: 10px; align-items: center;
  background: rgba(0,0,0,.05); padding: 10px 12px; border-radius: 10px;
  margin-bottom: 6px; color: var(--ib-ink); text-decoration: none; max-width: 280px;
}
.msg .file-card:hover { text-decoration: none; background: rgba(0,0,0,.08); }
.file-ic {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--ib-panel); border: 1px solid var(--ib-line);
  display: inline-flex; align-items: center; justify-content: center; color: var(--ib-ink-2);
}
.file-meta { display: flex; flex-direction: column; min-width: 0; }
.file-name { font-size: .87rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: .75rem; color: var(--ib-muted); }

.load-older-wrap { display: flex; justify-content: center; padding: 8px 0 4px; }

/* Closed-window note + template picker. */
.closed-note { text-align: center; padding: 20px 16px; margin-top: 10px; }
.closed-note p { margin: 0 0 12px; }
.template-panel {
  background: var(--ib-panel); border: 1px solid var(--ib-line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 12px; margin-bottom: 10px;
  max-height: 320px; overflow-y: auto;
}
.template-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.template-head strong { font-size: .88rem; }
.tpl-item { border: 1px solid var(--ib-line); border-radius: 10px; padding: 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.tpl-insert { border: 0; background: none; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 0; font: inherit; color: var(--ib-ink); }
.tpl-insert strong { font-size: .9rem; }
.tpl-body { font-size: .85rem; color: var(--ib-muted); white-space: pre-wrap; word-break: break-word; }
.tpl-insert:hover .tpl-body { color: var(--ib-accent-deep); }
.tpl-vars { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-vars label { font-size: .78rem; color: var(--ib-muted); display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 120px; }
.tpl-vars input { border: 1px solid var(--ib-line); border-radius: 8px; padding: 7px 10px; font: inherit; color: var(--ib-ink); min-width: 0; }
.tpl-send-btn { align-self: flex-end; }

/* Composer. */
.reply-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); position: relative; }
.reply-form.voice-recording .composer-row { display: none; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer-input {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px;
  background: var(--ib-panel); border: 1px solid var(--ib-line); border-radius: 24px;
  padding: 6px 8px; position: relative; box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.composer-input textarea {
  flex: 1; min-width: 0; border: 0; background: transparent; font: inherit;
  resize: none; outline: none; padding: 8px 4px; max-height: 120px; line-height: 1.4; color: var(--ib-ink);
}
.cbtn {
  flex-shrink: 0; width: 40px; height: 40px; border: 0; background: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--ib-muted); font-size: 1.2rem;
}
.cbtn:hover { background: var(--ib-panel-2); color: var(--ib-ink); }
.send-cbtn {
  flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--ib-accent); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.send-cbtn:hover { filter: brightness(1.08); }
.send-cbtn:disabled { opacity: .5; cursor: default; }
.suggest-cbtn { color: var(--ib-accent); }
.voice-rec { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--ib-panel-2); border: 1px solid var(--ib-line); border-radius: 12px; margin-top: 8px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; animation: recblink 1s infinite; flex-shrink: 0; }
@keyframes recblink { 50% { opacity: .3; } }
#voiceTimer { font-weight: 700; font-variant-numeric: tabular-nums; }
.voice-rec-label { color: var(--ib-muted); font-size: .85rem; flex: 1; }
.composer-attach { position: relative; }
.attach-menu { position: absolute; bottom: 100%; left: 0; margin-bottom: 8px; background: var(--ib-panel); border: 1px solid var(--ib-line); border-radius: 12px; box-shadow: var(--shadow); min-width: 150px; z-index: 20; overflow: hidden; }
.attach-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; color: var(--ib-ink); }
.attach-menu button:hover { background: var(--ib-panel-2); }
.emoji-panel { position: absolute; bottom: 100%; left: 10px; right: auto; /* beats the old right: 0 */ margin-bottom: 8px; background: var(--ib-panel); border: 1px solid var(--ib-line); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; z-index: 20; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-width: min(92vw, 360px); }
.emoji-panel button { border: 0; background: none; font-size: 1.4rem; padding: 4px; cursor: pointer; border-radius: 6px; }
.emoji-panel button:hover { background: var(--ib-panel-2); }
.attach-preview { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--ib-panel-2); border: 1px solid var(--ib-line); border-radius: 12px; margin-bottom: 8px; }
.suggest-slot { margin-top: 10px; }
.suggest-panel { margin-top: 0; }
.suggest-card { background: var(--ib-panel); border: 1px solid var(--ib-line); border-left: 3px solid #d99a16; border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.suggest-label { color: var(--ib-amber); font-weight: 700; font-size: .74rem; display: block; margin-bottom: 4px; }
.suggest-card p { margin: 0 0 8px; font-size: .88rem; white-space: pre-wrap; word-break: break-word; }
.suggest-card .actions { display: flex; gap: 8px; }

/* --- customer panel --- */
.customer-panel { display: none; }
.customer-mobile { margin-top: 12px; }
.customer-mobile summary { cursor: pointer; font-weight: 700; padding: 12px 16px; list-style: none; display: flex; align-items: center; gap: 8px; }
.customer-mobile summary::-webkit-details-marker { display: none; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.kv > span:first-child { flex-shrink: 0; }
.kv > span:last-child, .kv > strong:last-child { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.panel-close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--ib-line); background: var(--ib-panel); cursor: pointer;
  font-size: 1.1rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ib-ink-2); z-index: 2;
}
.panel-profile { text-align: center; padding: 8px 0 4px; }
.panel-name { font-size: 1.12rem; font-weight: 700; margin: 10px 0 2px; }
.panel-phone { font-size: .9rem; }
.panel-chan { margin-top: 8px; }
.panel-chan.wa { background: #dcf8e7; color: #128c4a; border-color: #a8e6c3; }
.panel-chan.ms { background: #dbeafe; color: #1d4ed8; border-color: #bcd3f7; }
.customer-panel .panel-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.customer-panel .panel-sec h4, .customer-mobile .panel-sec h4 { font-size: .85rem; font-weight: 700; color: var(--ib-ink-2); margin: 0 0 6px; }
.win-track { height: 7px; background: #e6ebe7; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.win-fill { display: block; height: 100%; border-radius: 999px; }
.win-fill.green { background: #1faa55; }
.win-fill.warn { background: #d99a16; }
.win-fill.red { background: var(--ib-red); }
.customer-panel .order-card { border: 1px solid var(--ib-line); border-radius: 12px; padding: 12px; background: var(--ib-panel-2); }
.customer-panel .order-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.customer-panel .order-item { margin-top: 6px; font-size: .88rem; }
.customer-panel .order-total { margin-top: 6px; font-weight: 700; }
.tag-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag-pill { background: var(--ib-accent-soft); color: var(--ib-accent-deep); padding: 4px 6px 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.tag-remove { border: 0; background: none; cursor: pointer; font-size: .95rem; line-height: 1; color: inherit; padding: 0 2px; }
.tag-add-row { display: flex; gap: 8px; }
.tag-add-row input { flex: 1; min-width: 0; font: inherit; border: 1px solid var(--ib-line); border-radius: 999px; padding: 9px 14px; color: var(--ib-ink); background: var(--ib-panel); }
.note-card { background: var(--ib-panel-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin-bottom: 10px; white-space: pre-wrap; word-break: break-word; }

/* Panel drawer (<1240px) + scrim. */
.panel-scrim { position: fixed; inset: 0; background: rgba(8,18,13,.45); z-index: 60; }
@media (max-width: 1239px) {
  .inbox-grid.with-panel .customer-panel {
    display: block; position: fixed; top: 0; right: 0; bottom: 0; width: min(88vw, 340px);
    z-index: 61; background: var(--ib-panel); border-left: 1px solid var(--ib-line);
    box-shadow: -4px 0 20px rgba(0,0,0,.12); overflow-y: auto; padding: 16px;
    transform: translateX(105%); transition: transform .22s ease;
  }
  .inbox-grid.with-panel .customer-panel.open { transform: none; }
}

/* Inbox toasts: bottom-centred, dark (the app toast is bottom-right). */
.page.inbox-page .toast-wrap { bottom: 26px; left: 50%; right: auto; transform: translateX(-50%); align-items: center; }
.page.inbox-page .toast-wrap .toast { background: var(--ib-ink); max-width: 92vw; }

/* --- breakpoints --- */
@media (max-width: 819px) {
  .page.inbox-page { padding: 12px 12px 90px; overflow-x: hidden; }
  .inbox-grid { max-width: 100%; overflow: hidden; }
  .conv-list { padding: 0; }
  .ftabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .ftabs::-webkit-scrollbar { display: none; }
  .ftab { flex-shrink: 0; }
  body.thread-open { overflow: hidden; }
  body.thread-open .page.inbox-page { padding-bottom: 0; overflow-x: hidden; }
  body.thread-open .thread {
    height: calc(100dvh - 130px);
    min-height: 0; max-height: none;
    width: 100%; max-width: 100%; overflow-x: hidden;
  }
  body.thread-open .messages { min-height: 0; overflow-x: hidden; }
  body.thread-open .msg { max-width: 85%; }
  body.thread-open .reply-form { max-width: 100%; overflow: hidden; }
  body.thread-open .composer-row { max-width: 100%; }
}
@media (max-width: 640px) {
  /* Chat subtitle shows only the phone number; AI label hides. */
  .th-chan, .th-sep { display: none; }
  .ai-label { display: none; }
  .thread-head { gap: 8px; padding: 9px 10px; }
  .thread-head .avatar { width: 40px; height: 40px; }
}
@media (min-width: 560px) {
  .assign-select { display: block; }
}
@media (min-width: 820px) {
  .inbox-grid { grid-template-columns: 348px minmax(0, 1fr); }
  .inbox-grid.with-panel { grid-template-columns: 348px minmax(0, 1fr); } /* beats the old 900px 280px rule */
  /* App-like fixed layout, no page scroll. */
  .page.inbox-page { height: calc(100dvh - 60px); display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
  .page.inbox-page .inbox-grid { flex: 1; min-height: 0; }
  .conv-list { max-height: none; height: 100%; overflow-y: auto; position: static; }
  .conv-list.card { overflow-y: auto; } /* beats .conv-list.card overflow:hidden (0,2,0) */
  .thread { display: flex; flex-direction: column; max-height: none; height: 100%; min-height: 0; }
  .thread .messages { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 6%; }
  .thread .reply-form { flex-shrink: 0; }
  body.thread-open .conv-list { display: block; }
  .customer-mobile { display: none; }
  .msg { max-width: 66%; }
  .page.inbox-page .mobile-only, .page.inbox-page .only-mobile { display: none !important; }
  .page.inbox-page .desktop-only, .page.inbox-page .only-desktop { display: revert; }
}
@media (min-width: 1240px) {
  .inbox-grid.with-panel { grid-template-columns: 372px minmax(0, 1fr) 330px; }
  .inbox-grid.with-panel .customer-panel {
    display: block; position: static; transform: none; width: auto; box-shadow: none;
  }
  #custPanelToggle { display: none; }
  .panel-close { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot, .rec-dot { animation: none; }
  .inbox-grid.with-panel .customer-panel { transition: none; }
}
