/* Arvo - E-commerce ERP by Arqent Solutions. Interface styles.
   Direction
   Product   the back office of a Pakistani online seller: orders, stock, couriers, money
   Character steady, exact, quick to scan
   World     the order ledger and the dispatch counter: graphite surfaces, ledger-green ink for the one accent
             (same family as Rivo, its chat app, so the two feel like one suite)
   Moments   the orders table and the day's numbers strip
   Signature every money figure in tabular figures with "Rs", every status as a small dot + word
*/
:root {
  /* ARVO theme (see Arvo/BRAND.txt): deep green of the logo for actions, light green tint for selected things */
  --bg: #f5f8f7; --card: #ffffff; --raised: #eef3f1; --sunken: #e8eeeb;
  --text: #10231c; --text-2: #46564f; --text-3: #68776f;
  --line: rgba(10, 61, 51, .10); --line-2: rgba(10, 61, 51, .17);
  --accent: #0b6b4d; --accent-ink: #0a4a3c; --on-accent: #ffffff; --sel: #e3f3ea;
  --warn-bg: #fdf3dc; --warn-ink: #7a5200; --ok: #16803c; --bad: #c62828; --info: #1d5fb8;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --head: #0a3d33;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #141415; --card: #19191b; --raised: #232325; --sunken: #0f0f10;
  --text: #ededed; --text-2: #a1a1a6; --text-3: #85858b;
  --line: rgba(237, 237, 237, .09); --line-2: rgba(237, 237, 237, .15);
  --accent: #3f9b7b; --accent-ink: #6cc3a3; --on-accent: #08130f; --sel: #1d2623;
  --warn-bg: #2e2612; --warn-ink: #e6c66a; --ok: #4cc38a; --bad: #ef6b6f; --info: #7ab0f5;
  --shadow-1: none; --shadow-2: 0 0 0 1px var(--line-2);
  --head: #1c3a2f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { overflow: hidden; }
body { font: 400 14px/20px "Geist", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.sr { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; width: 1px; height: 1px; overflow: hidden; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s { width: 16px; height: 16px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.grow { flex: 1; min-width: 0; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: 48px minmax(0, 1fr); height: 100dvh; }
.side { grid-row: 1 / -1; background: var(--sunken); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.brand-btn { flex: 1; min-width: 0; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 6px; border-radius: 8px; text-align: left; }
.brand-btn:hover { background: var(--raised); }
.mark { width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.brand-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-btn small { display: block; font-weight: 400; font-size: 12px; line-height: 14px; color: var(--text-3); }
.nav { flex: 1; overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.nav h2 { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-3); padding: 0 8px; margin: 20px 0 6px; }
.nav-item { width: 100%; height: 32px; display: flex; align-items: center; gap: 10px; padding: 0 8px; border-radius: 8px; color: var(--text-2); text-align: left; }
.nav-item + .nav-item { margin-top: 2px; }
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--card); color: var(--text); font-weight: 500; box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.nav-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; color: var(--text-3); font-weight: 400; }
.nav-item .count.hot { color: var(--on-accent); background: var(--accent); border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px; line-height: 18px; text-align: center; font-weight: 600; font-size: 11px; }
.side-foot { flex: none; border-top: 1px solid var(--line); padding: 8px; display: flex; align-items: center; gap: 4px; }
.me { flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 6px; border-radius: 8px; text-align: left; }
.me:hover { background: var(--raised); }
.me b { display: block; font-weight: 500; font-size: 13px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { display: block; font-size: 12px; line-height: 14px; color: var(--text-3); }
.av { width: 24px; height: 24px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 11px; font-weight: 500; color: var(--text-2); flex: none; }

.top { display: flex; align-items: center; gap: 8px; padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--line); min-width: 0; }
.ibtn.menu-btn { display: none; }
.gsearch { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 8px; background: var(--raised); color: var(--text-3); border: 1px solid transparent; }
.gsearch:focus-within { border-color: var(--accent); background: var(--card); }
.gsearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); }
.gsearch input::placeholder { color: var(--text-3); }
kbd { font: 500 11px/16px inherit; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.top-space { flex: 1; }
.ibtn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); flex: none; position: relative; }
.ibtn:hover { background: var(--raised); color: var(--text); }
.ibtn:active, .btn:active { transform: scale(.98); }
.ibtn .pip { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); border: 1.5px solid var(--card); }
.btn { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; border: 1px solid var(--line-2); background: var(--card); color: var(--text); }
.btn:hover { background: var(--raised); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-ink); }
[data-theme="dark"] .btn.primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn.sm { height: 28px; padding: 0 8px; }
.btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.main { overflow-y: auto; overscroll-behavior: contain; min-width: 0; }
.page { max-width: 1360px; margin: 0 auto; padding: 20px 24px 48px; display: grid; gap: 16px; }
.page.narrow { max-width: 880px; }
.page-head { display: flex; align-items: center; gap: 12px; min-height: 32px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; line-height: 28px; font-weight: 600; }
.page-head .sub { color: var(--text-3); font-size: 13px; }
.page-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cards + numbers strip ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; min-height: 48px; }
.card-head h2 { font-size: 14px; line-height: 20px; font-weight: 600; flex: 1; }
.card-head .btn { margin: -2px 0; }
.card-body { padding: 0 16px 16px; }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { padding: 14px 16px; border-right: 1px solid var(--line); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat dt { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.stat dd { font-size: 22px; line-height: 28px; font-weight: 500; margin-top: 4px; white-space: nowrap; }
.stat small { display: block; font-size: 12px; line-height: 16px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat small.up, .up { color: var(--ok); } .stat small.down, .down { color: var(--bad); }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- status, tags ---------- */
.st { font-size: 12px; line-height: 16px; padding: 2px 7px 2px 6px; border-radius: 5px; display: inline-flex; align-items: center; gap: 5px; background: var(--raised); color: var(--text-2); white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 11%, var(--card)); }
.st.wait { color: var(--warn-ink); background: var(--warn-bg); }
.st.move { color: var(--info); background: color-mix(in srgb, var(--info) 10%, var(--card)); }
.st.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--card)); }
/* channel marks and product thumbnails: the colour comes from the brand or the product, never from decoration */
.chn { width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: var(--c, #525252); flex: none; vertical-align: middle; }
.chn.lg { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.thumb { width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; background: hsl(var(--h, 150) 45% 92%); color: hsl(var(--h, 150) 45% 30%); border: 1px solid var(--line); }
[data-theme="dark"] .thumb { background: hsl(var(--h, 150) 22% 22%); color: hsl(var(--h, 150) 45% 78%); }
img.chn.logo { background: #fff; border: 1px solid var(--line); object-fit: contain; padding: 2px; }
img.chn.logo.lg { padding: 3px; }
/* customer profile (the old ERP's layout, in Arvo's colours) */
.cp-total { display: grid; justify-items: end; gap: 4px; flex: none; }
.cp-total b { font-size: 17px; font-weight: 600; }
.sh-top .with { gap: 4px; }
.sh-top .with svg { width: 14px; height: 14px; }
.cp-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cp-acts .btn { height: 40px; }
.chn.ic, img.chn.logo.ic { width: 18px; height: 18px; border-radius: 5px; border: 0; padding: 0; background: none; }
.cp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.cp-grid div { min-width: 0; }
.cp-grid small { display: block; font-size: 12px; color: var(--text-3); }
.cp-grid b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-hist-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cp-hist-head h3 { margin: 0; color: var(--text); font-weight: 600; }
.cp-hist { display: grid; gap: 8px; }
.cp-order { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; width: 100%; }
.cp-order:hover { background: var(--raised); }
.cp-order b { display: block; font-weight: 500; }
.cp-order small { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-amt { display: grid; justify-items: end; gap: 3px; flex: none; }
.sh-foot.three { display: grid; grid-template-columns: repeat(3, 1fr); }
.sh-foot.three .btn { height: 36px; }
.tbl td small.with.tight { display: flex; gap: 4px; align-items: center; }
.tbl td small.with.tight svg { width: 12px; height: 12px; margin-left: 6px; }
.tb { position: relative; display: inline-grid; flex: none; }
.chn.mini { position: absolute; right: -5px; bottom: -5px; width: 17px; height: 17px; border-radius: 5px; border: 2px solid var(--card); font-size: 8px; padding: 0; box-sizing: border-box; }
img.chn.logo.mini { padding: 1px; }
tr:hover .chn.mini { border-color: var(--raised); }
.tbl td small.tiny { font-size: 11px; line-height: 13px; }
.lead-lg > * { width: 52px; height: 52px; border-radius: 12px; font-size: 16px; }
.lead-lg > .ava { border-radius: 50%; }
.lead-lg svg { width: 22px; height: 22px; }
.notice.plain { background: var(--raised); color: var(--text-2); }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.acct { padding: 14px; display: grid; gap: 10px; align-content: start; }
.acct header { display: flex; align-items: center; gap: 10px; }
.acct header b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct header small { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acct .mini div:nth-child(2) { border-right: 0; }
.acct .mini div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.acct-bal { font-size: 22px; line-height: 28px; font-weight: 500; }
.acct-io { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--text-2); }
.acct-io b { font-weight: 500; color: var(--text); }
.form-sheet .sec > h3 { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.form-sheet .sec > h3::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); }
.form-sheet .sec + .sec { padding-top: 16px; border-top: 1px solid var(--line); }
.thumb.lg { width: 52px; height: 52px; border-radius: 12px; font-size: 16px; }
.bars-svg { display: block; width: 100%; height: 56px; fill: var(--text); margin-bottom: 4px; }
.with { display: flex; align-items: center; gap: 10px; min-width: 0; }
.with > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dotc { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--text-3)); display: inline-block; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0 16px 12px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.stat dt svg { color: var(--text-3); }
.band { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; flex-wrap: wrap; }
.band .grow { color: inherit; }
.band .btn { margin-left: auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 0 16px 16px; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: left; display: grid; gap: 2px; background: var(--card); }
.tile:hover { border-color: var(--line-2); background: var(--raised); }
.tile b { font-weight: 500; font-size: 16px; line-height: 22px; }
.tile small { font-size: 12px; color: var(--text-3); }
.tag { font-size: 12px; line-height: 16px; padding: 2px 6px; border-radius: 5px; background: var(--raised); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- index pages (tabs + toolbar + table) ---------- */
.tabs { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { height: 40px; padding: 0 8px; color: var(--text-2); font-size: 13px; font-weight: 500; position: relative; white-space: nowrap; display: flex; align-items: center; gap: 6px; flex: none; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }
.tabs .count { font-size: 12px; font-weight: 400; color: var(--text-3); }
.tools { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); color: var(--text-3); width: 280px; max-width: 100%; }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); }
.search input::-webkit-search-cancel-button { display: none; }
.sel { height: 32px; padding: 0 28px 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center; color: var(--text); font-size: 13px; appearance: none; max-width: 100%; }
.sel:focus { outline: 0; border-color: var(--accent); }
.bulk { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--sel); font-size: 13px; flex-wrap: wrap; }
.bulk b { font-weight: 500; margin-right: 4px; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; height: 36px; padding: 0 12px; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; }
.tbl td { height: 44px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--raised); }
.tbl tbody tr[aria-selected="true"] { background: var(--sel); }
.tbl .r { text-align: right; }
.tbl .chk { width: 36px; padding-right: 0; }
.tbl td.first b { font-weight: 500; }
.tbl td small { display: block; font-size: 12px; line-height: 14px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; vertical-align: middle; cursor: pointer; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.foot .pager { display: flex; gap: 4px; }
.empty { padding: 48px 24px; text-align: center; color: var(--text-3); display: grid; gap: 12px; justify-items: center; }
.cards-m { display: none; }

/* ---------- lists inside cards ---------- */
.rows { display: grid; }
.rowl { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 16px; border-top: 1px solid var(--line); text-align: left; width: 100%; }
button.rowl:hover { background: var(--raised); }
.rowl:last-child { border-radius: 0 0 12px 12px; }
.rowl .grow b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowl .grow small { display: block; font-size: 12px; line-height: 16px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowl .ico { width: 28px; height: 28px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; color: var(--text-2); flex: none; }
.rowl .ico.warn { background: var(--warn-bg); color: var(--warn-ink); }
.bars { display: grid; gap: 10px; padding: 0 16px 16px; }
.bar { display: grid; grid-template-columns: 124px minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: 13px; }
.bar i { display: block; height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.bar i b { display: block; height: 100%; border-radius: 4px; background: var(--text-3); }
.bar.lead i b { background: var(--accent); }
.bar .r { text-align: right; color: var(--text-2); }
.chart { padding: 0 16px 12px; }
.chart svg { display: block; width: 100%; height: 220px; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .bx { fill: var(--line-2); }
.chart .bx.now { fill: var(--accent); }
.chart text { fill: var(--text-3); font-size: 11px; font-family: inherit; }

/* ---------- drawer (details + forms) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .32); z-index: 30; width: 100%; cursor: default; }
.drawer { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--card); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-2); display: flex; flex-direction: column; animation: slide .26s var(--ease); }
.drawer.wide { width: min(760px, 100%); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.dr-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); min-height: 56px; }
.dr-head h2 { font-size: 16px; line-height: 24px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px 24px; display: grid; gap: 20px; align-content: start; }
.dr-foot { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.sec h3 { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.box table.tbl td { height: 40px; }
.box .tbl tbody tr { cursor: default; }
.box .tbl tbody tr:hover { background: none; }
.sum { display: grid; gap: 4px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.sum div { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); }
.sum div.total { color: var(--text); font-weight: 500; font-size: 14px; }
.act-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tl { display: grid; gap: 0; }
.tl li { list-style: none; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding-bottom: 12px; position: relative; font-size: 13px; }
.tl { padding: 0; margin: 0; }
.tl li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin: 6px 4px 0; }
.tl li.on::before { background: var(--accent); }
.tl li:not(:last-child)::after { content: ""; position: absolute; left: 7.500px; top: 16px; bottom: 0; width: 1px; background: var(--line-2); }
.tl small { display: block; font-size: 12px; color: var(--text-3); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fld { display: grid; gap: 4px; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.inp { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); min-width: 0; width: 100%; }
textarea.inp { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }
.inp:focus { outline: 0; border-color: var(--accent); }
select.inp { appearance: none; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; padding-right: 28px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch i { width: 28px; height: 16px; border-radius: 8px; background: var(--line-2); position: relative; transition: background-color .16s var(--ease); flex: none; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .16s var(--ease); }
.switch[aria-checked="true"] i { background: var(--accent); }
.switch[aria-checked="true"] i::after { transform: translateX(12px); }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; }
.notice svg { margin-top: 2px; }

/* ---------- sheet: an order or a customer, opened in the middle (full screen on a phone) ---------- */
.sheet { position: fixed; z-index: 31; left: 50%; top: 4vh; transform: translateX(-50%); width: min(540px, calc(100% - 24px)); max-height: 92vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-2); overflow: hidden; animation: rise .22s var(--ease); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
/* on a phone nothing shows a scroll bar (the owner finds it ugly); everything still scrolls by touch */
@media (max-width: 860px) {
  * { scrollbar-width: none; -ms-overflow-style: none; }
  *::-webkit-scrollbar { width: 0; height: 0; display: none; }
}
@keyframes rise { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }
/* the top of every sheet is a dark band in the brand green with light text (the owner asked for a darker, coloured top) */
.sh-top { flex: none; background: var(--head); color: #fff; padding: 14px 12px 14px 16px; display: grid; gap: 8px; }
.sh-top .sub, .sh-top .sh-row.sub { color: rgba(255, 255, 255, .8); }
.sh-top .ibtn { color: rgba(255, 255, 255, .9); }
.sh-top .ibtn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.sh-top .tag { background: rgba(255, 255, 255, .16); border-color: transparent; color: #fff; }
.sh-top .st { background: #fff; }
.sh-top .ava, .sh-top .thumb, .sh-top .cico, .sh-top .kico { box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); }
.sh-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sh-row.sub, .sh-top .sub { font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.sh-id { font-size: 17px; line-height: 24px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.sh-total { font-size: 17px; font-weight: 600; white-space: nowrap; }
.push { margin-left: auto; }
.sh-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 18px; display: grid; gap: 16px; align-content: start; }
.sh-foot { flex: none; display: flex; gap: 6px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; background: var(--card); }
.sh-foot::-webkit-scrollbar { display: none; }
.sh-foot .btn { flex: none; }
.btn.danger { color: var(--bad); }
.ava { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; font-weight: 500; flex: none; background: hsl(var(--h, 150) 45% 91%); color: hsl(var(--h, 150) 45% 28%); }
.ava.lg { width: 52px; height: 52px; font-size: 17px; }
[data-theme="dark"] .ava { background: hsl(var(--h, 150) 22% 24%); color: hsl(var(--h, 150) 45% 78%); }
.who { display: flex; align-items: center; gap: 12px; }
.who b { display: block; font-weight: 500; }
.who small { display: block; font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.ibtn.line { border: 1px solid var(--line-2); border-radius: 50%; width: 36px; height: 36px; }
.ibtn.sm { width: 28px; height: 28px; }
.racts { display: inline-flex; align-items: center; gap: 2px; justify-content: flex-end; width: 100%; }
.rowl.first:first-child { border-top: 0; }
.rowl .r { text-align: right; font-size: 13px; line-height: 22px; flex: none; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile.c { justify-items: center; padding: 12px 8px; gap: 6px; color: var(--accent-ink); font-size: 13px; font-weight: 500; }
.mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; }
.mini div { padding: 10px 12px; border-right: 1px solid var(--line); min-width: 0; }
.mini div:last-child { border-right: 0; }
.mini dt { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini dd { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc { border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.acc summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; font-weight: 500; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary span:first-child { flex: 1; }
.acc summary svg { color: var(--text-3); transition: transform .16s var(--ease); }
.acc[open] summary svg { transform: rotate(90deg); }
.acc .tl { padding: 4px 12px 0; display: none; }
.acc .acc-ld { padding: 0 12px 12px; font-size: 13px; }
.acc.ready .tl { display: grid; }
.acc.ready .acc-ld { display: none; }
/* dashboard */
.page-head.one { flex-wrap: nowrap; justify-content: space-between; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpis.auto { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.kico, .cico { width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; background: var(--sel); color: var(--accent-ink); }
.kico.ok { background: color-mix(in srgb, var(--ok) 12%, var(--card)); color: var(--ok); }
.kico.warn { background: var(--warn-bg); color: var(--warn-ink); }
.kico.bad { background: color-mix(in srgb, var(--bad) 10%, var(--card)); color: var(--bad); }
.kico.info { background: color-mix(in srgb, var(--info) 10%, var(--card)); color: var(--info); }
.cico { background: hsl(var(--h, 150) 45% 92%); color: hsl(var(--h, 150) 45% 30%); }
.cico.lg { width: 52px; height: 52px; border-radius: 12px; }
.cico.lg svg { width: 22px; height: 22px; }
[data-theme="dark"] .cico { background: hsl(var(--h, 150) 22% 22%); color: hsl(var(--h, 150) 45% 78%); }
.sheet.form-sheet { width: min(820px, calc(100% - 24px)); }
.form-sheet .form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sh-foot.end { justify-content: flex-end; }
input[type="file"].inp { padding: 6px 10px; height: auto; }
.kpi dt { font-size: 13px; color: var(--text-2); }
.kpi dd { font-size: 20px; line-height: 28px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { font-size: 12px; color: var(--text-3); }
.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile .st { justify-self: start; }

/* ---------- menus, toast ---------- */
.menu { position: fixed; z-index: 40; min-width: 220px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-2); padding: 4px; animation: pop .16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } }
.menu h3 { font-size: 12px; font-weight: 500; color: var(--text-3); padding: 8px 8px 4px; }
.menu button, .menu a { width: 100%; min-height: 32px; display: flex; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 8px; text-align: left; font-size: 13px; }
.menu button:hover, .menu a:hover { background: var(--raised); }
.menu button small { margin-left: auto; color: var(--text-3); font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 8px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-2); animation: pop .2s var(--ease); display: flex; align-items: center; gap: 8px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 12px; }
.pitem { border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: left; display: grid; gap: 2px; background: var(--card); }
.pitem:hover { border-color: var(--accent); }
.pitem b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem small { color: var(--text-3); font-size: 12px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; height: 28px; }
.qty button { width: 26px; height: 26px; display: grid; place-items: center; color: var(--text-2); }
.qty span { min-width: 22px; text-align: center; font-size: 13px; }

/* ---------- settings ---------- */
.set { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-nav { display: grid; gap: 2px; position: sticky; top: 0; }
.set-nav .nav-item[aria-current="page"] { background: var(--card); }
.int { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.int-card { padding: 14px; display: grid; gap: 8px; }
.int-card header { display: flex; align-items: center; gap: 10px; }
.int-card .logo { width: 32px; height: 32px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--text-2); flex: none; }
.int-card h3 { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.int-card p { font-size: 13px; color: var(--text-2); min-height: 40px; }

/* ---------- responsive ---------- */
@media (max-width: 1500px) {
  .tbl th, .tbl td { padding: 0 6px; }
  .tbl td { max-width: 190px; }
  .racts .btn.sm { padding: 0 6px; }
  .tbl .chk { padding-left: 12px; }
}
@media (max-width: 1100px) {
  .cols, .cols.even, .cols.three, .pos { grid-template-columns: minmax(0, 1fr); }
  .set { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .set-nav { display: flex; overflow-x: auto; position: static; scrollbar-width: none; }
  .set-nav .nav-item { width: auto; flex: none; }
  .set-nav .nav-item + .nav-item { margin: 0 0 0 2px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(280px, 86%); z-index: 35; transform: translateX(-100%); transition: transform .26s var(--ease); box-shadow: var(--shadow-2); }
  .app.nav-open .side { transform: none; }
  .ibtn.menu-btn { display: grid; }
  .top { padding: 0 8px; }
  .gsearch kbd, .top .hide-m { display: none; }
  .page { padding: 16px 12px 40px; gap: 12px; }
  .page-head h1 { font-size: 18px; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat dd { font-size: 18px; line-height: 24px; }
  .tbl-wrap { display: none; }
  .cards-m { display: grid; }
  .mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; width: 100%; }
  .mrow b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mrow small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mrow .r { text-align: right; justify-self: end; }
  .tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tools::-webkit-scrollbar { display: none; }
  .tools .search { width: auto; flex: 0 0 220px; }
  .tools .sel { flex: none; }
  .page-head { flex-wrap: nowrap; }
  .page-head h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-head .acts .hide-m { display: none; }
  .kpis.auto { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px; gap: 8px; }
  .kpi .kico { width: 28px; height: 28px; }
  .page-head .sub { display: none; }
  .page-head .acts { flex-wrap: nowrap; }
  .page-head .acts .btn:not(.primary) { width: 40px; padding: 0; }
  /* on a phone a sheet comes up from the bottom: a little of the page shows above it and its top is rounded */
  .sheet, .sheet.form-sheet { inset: 28px 0 0 0; transform: none; width: 100%; max-height: none; border: 0; border-radius: 20px 20px 0 0; animation: up .26s var(--ease); }
  .form-sheet .form { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi dd { font-size: 18px; line-height: 24px; }
  .mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini div:nth-child(2) { border-right: 0; }
  .mini div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .mrow.lead { grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 12px; }
  .mrow.lead > :first-child { grid-row: 1 / span 2; align-self: center; }
  .sh-foot .btn { height: 40px; }
  .inp, .gsearch input, .search input, .sel { font-size: 16px; }
  .inp, .sel, .search, .btn { height: 40px; }
  .btn.sm { height: 36px; }
  .ibtn { width: 40px; height: 40px; }
  .nav-item { height: 40px; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 112px minmax(0, 1fr); }
  .drawer, .drawer.wide { width: 100%; border-left: 0; }
  .bar { grid-template-columns: 104px minmax(0, 1fr) 40px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- sign-in screens of the live layer ---------- */
.auth { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.auth[hidden] { display: none; }
.auth-card { width: min(360px, 100%); background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-2); padding: 24px; display: grid; gap: 12px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.auth-brand .mark { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
.auth-card h1 { font-size: 20px; font-weight: 600; }
.auth-form { display: grid; gap: 6px; }
.auth-form label { font-size: 13px; font-weight: 500; color: var(--text-2); margin-top: 6px; }
.auth-form .inp { height: 40px; font-size: 16px; }
.auth-err { min-height: 20px; font-size: 13px; color: var(--bad); }
.btn.block { width: 100%; height: 40px; }

/* ---------- round of 28 Nov (later 18) ---------- */
/* brand logos are shown as they are: no white tile and no border behind them (the owner asked for plain PNG logos) */
img.chn.logo, img.chn.logo.lg, img.chn.logo.mini { background: none; border: 0; padding: 0; border-radius: 5px; object-fit: contain; }
img.chn.logo.mini { background: var(--card); border: 2px solid var(--card); border-radius: 6px; }
img.chn.logo[alt="WooCommerce"], img.chn.logo[alt="TikTok"] { padding: 2px; }
img.chn.logo.lg[alt="WooCommerce"], img.chn.logo.lg[alt="TikTok"] { padding: 4px; }
[data-theme="dark"] img.chn.logo:not(.ic) { background: #fff; padding: 2px; }
.sh-top img.chn.logo { background: #fff; padding: 2px; border-radius: 6px; }
.sh-top .thumb, .sh-top .cico, .sh-top .ava { background: #fff; border: 0; }
/* row and section shortcuts with a little colour */
.tint { border-color: transparent; background: var(--raised); color: var(--text-2); }
.tint:hover { background: var(--line-2); color: var(--text); }
.tint.info { background: color-mix(in srgb, var(--info) 11%, var(--card)); color: var(--info); }
.tint.info:hover { background: color-mix(in srgb, var(--info) 18%, var(--card)); color: var(--info); }
.tint.warn { background: var(--warn-bg); color: var(--warn-ink); }
.tint.warn:hover { background: color-mix(in srgb, var(--warn-ink) 16%, var(--warn-bg)); color: var(--warn-ink); }
.tint.ok { background: color-mix(in srgb, var(--ok) 12%, var(--card)); color: var(--ok); }
.tint.ok:hover { background: color-mix(in srgb, var(--ok) 19%, var(--card)); color: var(--ok); }
.racts { gap: 4px; }
/* the shortcut row never scrolls sideways; what does not fit goes into More (see fitFoot in app.js) */
.sheet { width: min(580px, calc(100% - 24px)); }
.sh-foot { overflow: hidden; }
.sh-foot > .grow { flex: 1 1 0; min-width: 0; }
.menu button.danger { color: var(--bad); }
/* dialogs on top of a record */
.scrim.top { z-index: 33; }
.sheet.dlg { z-index: 34; top: 7vh; width: min(480px, calc(100% - 24px)); max-height: 86vh; }
.sheet.dlg.wide { width: min(780px, calc(100% - 24px)); }
.dlg .sh-body { display: grid; gap: 12px; align-content: start; }
.dlg .sh-foot { gap: 8px; flex-wrap: wrap; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); min-width: 0; }
.seg button b { display: block; font-weight: 500; font-size: 13px; }
.seg button small { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button > span { min-width: 0; }
.seg button:hover { background: var(--raised); }
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--sel); box-shadow: inset 0 0 0 1px var(--accent); }
.with-btn { display: flex; gap: 8px; }
.with-btn .inp { flex: 1; min-width: 0; }
.with-btn .btn { height: 36px; flex: none; }
.sum.flat { border-top: 0; }
.bubble { white-space: pre-wrap; font-size: 13px; line-height: 20px; padding: 10px 12px; border-radius: 4px 12px 12px 12px; background: color-mix(in srgb, var(--ok) 9%, var(--card)); border: 1px solid var(--line); overflow-wrap: anywhere; }
.proof { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.proof b { display: block; font-weight: 500; font-size: 13px; }
.proof small { display: block; font-size: 12px; color: var(--text-3); }
.proof .kico.num { font-weight: 600; font-size: 13px; }
.prog { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.tbl-wrap.dlg-tbl { display: block; border: 1px solid var(--line); border-radius: 10px; max-height: 300px; overflow: auto; }
.dlg-tbl .tbl td, .dlg-tbl .tbl th { padding-top: 8px; padding-bottom: 8px; }
/* pickers inside forms */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.icon-grid button { height: 40px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-2); background: var(--card); }
.icon-grid button:hover { background: var(--raised); color: var(--text); }
.icon-grid button[aria-checked="true"], .bank-grid button[aria-checked="true"] { border-color: var(--accent); background: var(--sel); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 196px; overflow-y: auto; padding: 2px; border: 1px solid var(--line); border-radius: 10px; }
.bank-grid button { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; font-size: 13px; text-align: left; min-width: 0; }
.bank-grid button span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bank-grid button:hover { background: var(--raised); }
/* settings: one row per setting */
.scol { display: grid; gap: 12px; max-width: 760px; min-width: 0; }
.srow { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); min-height: 56px; }
.sgroup .card-head + .srow { border-top: 0; }
.srow b { display: block; font-weight: 500; font-size: 14px; }
.srow small { display: block; font-size: 12px; color: var(--text-3); }
.sctl { width: 280px; flex: none; display: flex; justify-content: flex-end; }
.sctl .inp { width: 100%; }
.srow.sw .sctl { width: auto; }
.meter { display: block; width: 140px; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.set-nav .nav-item { gap: 10px; }
@media (max-width: 860px) {
  .sheet.dlg, .sheet.dlg.wide { inset: auto 0 0 0; top: auto; width: 100%; max-height: calc(100% - 44px); border-radius: 20px 20px 0 0; }
  .dlg .sh-foot .btn { flex: 1 1 auto; }
  .seg.three { grid-template-columns: minmax(0, 1fr); }
  .with-btn .btn { height: 40px; }
  .srow { flex-direction: column; align-items: stretch; gap: 8px; }
  .srow.sw { flex-direction: row; align-items: center; }
  .sctl { width: 100%; justify-content: flex-start; }
  .srow.sw .sctl { width: auto; }
  .bank-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* logos sit straight on the dark top of a sheet too; only a black logo (TikTok) keeps a light tile so it stays visible */
.sh-top img.chn.logo { background: none; padding: 0; }
.sh-top img.chn.logo[alt="TikTok"] { background: #fff; padding: 2px; }
/* thin, quiet scroll bars on desktop (none at all on a phone) */
@media (min-width: 861px) { * { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; } }
.sheet.dlg .sh-top .sub { color: rgba(255, 255, 255, .82); font-size: 13px; }
.sheet .sh-top .sub, .sheet .sh-top .sub .num, .sheet .sh-top .sh-row.sub > span:not(.st):not(.push) { color: rgba(255, 255, 255, .82); }
/* one field per row (Connect forms) */
.form.one, .form-sheet .form.one { grid-template-columns: minmax(0, 1fr); }

/* the product logo (files in brand/, cut from the owner's approved logo sheet) */
.brand-logo { width: 30px; height: 30px; object-fit: contain; flex: none; }
.auth-logo { height: 46px; width: auto; max-width: 100%; object-fit: contain; object-position: left; display: block; }

/* ---------- sign-in, sign-up, verify email, choose a plan ---------- */
.auth { padding: 24px 16px; place-items: center; }
.auth-wrap { width: min(920px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-2); overflow: hidden; margin: auto; }
.auth-wrap.wide { width: min(1200px, 100%); grid-template-columns: 1fr; }
.auth-side { padding: 40px; display: grid; align-content: start; gap: 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 5%, var(--card)), color-mix(in srgb, var(--accent) 16%, var(--card))); border-right: 1px solid var(--line); }
.auth-side .auth-logo { height: 48px; margin-bottom: 16px; }
.auth-side h2 { font-size: 26px; line-height: 34px; font-weight: 600; letter-spacing: -.01em; color: var(--text); text-wrap: balance; }
.auth-side h2 em { font-style: normal; color: var(--accent); }
.auth-side > p { font-size: 14px; line-height: 22px; color: var(--text-2); max-width: 34ch; }
.auth-feats { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 14px; }
.auth-feats li { display: flex; align-items: center; gap: 12px; }
.auth-feats b { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.auth-feats small { display: block; font-size: 13px; color: var(--text-2); }
.auth-fi { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--card); color: var(--accent); border: 1px solid var(--line); }
.auth-wrap .auth-card { width: auto; border: 0; border-radius: 0; box-shadow: none; padding: 40px; align-content: center; gap: 10px; background: var(--card); }
.auth-wrap:not(.wide) .card-logo { display: none; }
.auth-card h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.01em; }
.auth-card > .muted { font-size: 14px; line-height: 20px; margin-bottom: 4px; }
.auth-form .inp, .auth-form input:not([type="checkbox"]) { height: 44px; font-size: 16px; border-radius: 10px; }
.auth-pw { position: relative; display: block; }
.auth-pw .inp, .auth-pw input { padding-right: 44px; width: 100%; }
.auth-eye { position: absolute; right: 2px; top: 2px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--text-2); border-radius: 8px; background: none; border: 0; cursor: pointer; }
.auth-eye:hover { color: var(--text); }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.auth-form label.auth-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; color: var(--text-2); cursor: pointer; }
.auth-check input { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.auth-link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }
.auth-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-err.ok { color: var(--accent); }
.auth-card .btn.block { width: 100%; height: 44px; font-size: 15px; border-radius: 10px; }
.auth-card .btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.auth-alt { text-align: center; font-size: 13px; color: var(--text-2); margin-top: 6px; }
.plans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 8px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px 16px 16px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--card); min-width: 0; }
.plan.hot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-tag { position: absolute; top: -10px; left: 16px; height: 20px; padding: 0 8px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; line-height: 20px; }
.plan h3 { font-size: 16px; font-weight: 600; }
.plan-for { font-size: 13px; line-height: 18px; color: var(--text-2); min-height: 36px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; }
.plan-price b { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.01em; }
.plan-price small { font-size: 13px; color: var(--text-2); }
.plan-setup { font-size: 12px; line-height: 18px; color: var(--text-2); min-height: 36px; }
.plan-setup s { opacity: .7; }
.plan-setup span { font-weight: 600; color: var(--text); }
.plan ul { list-style: none; margin: 6px 0 14px; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; flex: 1; align-content: start; }
.plan li { display: flex; gap: 8px; font-size: 13px; line-height: 18px; color: var(--text); }
.plan li .i { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-eye .i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.plan .btn.block { text-decoration: none; }
.plan-notes { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 12px; line-height: 18px; color: var(--text-2); }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .auth { padding: 0; place-items: stretch; background: var(--card); }
  .auth-wrap, .auth-wrap.wide { grid-template-columns: 1fr; border: 0; border-radius: 0; box-shadow: none; width: 100%; margin: 0; }
  .auth-side { display: none; }
  .auth-wrap .auth-card { padding: 28px 20px 32px; align-content: start; }
  .auth-wrap:not(.wide) .card-logo { display: block; margin-bottom: 12px; }
  .plans { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } .plan-for, .plan-setup { min-height: 0; } }
img.thumb { object-fit: cover; padding: 0; background: var(--card, #fff); }

/* ---------- city picker: the whole list with a search box ---------- */
.cpick-wrap .cp-scrim { z-index: 44; }
.cpick { position: fixed; z-index: 45; left: 50%; top: 6vh; transform: translateX(-50%); width: min(440px, calc(100% - 24px)); height: min(640px, 88vh); display: grid; grid-template-rows: auto auto minmax(0, 1fr); background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); overflow: hidden; }
.cpick > header { display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 16px; }
.cpick > header span { flex: 1; min-width: 0; display: grid; }
.cpick > header b { font-size: 15px; font-weight: 500; }
.cpick > header small { font-size: 12px; color: var(--text-3); }
.cp-x { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); background: none; border: 0; cursor: pointer; }
.cp-x:hover { background: var(--raised, rgba(0, 0, 0, .05)); }
.cp-search { padding: 0 12px 8px; }
.cp-search .inp { width: 100%; height: 36px; }
.cp-list { overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 8px; }
.cp-list button { display: block; width: 100%; height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: none; text-align: left; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.cp-list button:hover, .cp-list button:focus-visible { background: var(--raised, rgba(0, 0, 0, .05)); }
.cp-list button[aria-selected="true"] { background: var(--sel); color: var(--accent); font-weight: 500; }
.cp-list p { padding: 12px 8px; margin: 0; font-size: 13px; }
[data-citypick] { cursor: pointer; }
@media (max-width: 640px) { .cpick { inset: 0; left: 0; top: 0; transform: none; width: 100%; height: 100dvh; border: 0; border-radius: 0; } .cp-list button { height: 44px; } .cp-search .inp { height: 44px; font-size: 16px; } }

/* long names never push a card wider than its column */
.cols > *, .card { min-width: 0; }
.rowl > .num, .rowl > .r { flex: none; white-space: nowrap; }
.rowl .grow { overflow: hidden; }
.rows { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.rowl { min-width: 0; max-width: 100%; }
/* order / product window: a long product title is cut, the window never scrolls sideways */
.sh-body { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
.sh-body > *, .sh-body .sec > *, .sh-body .box, .sh-body .box > * { min-width: 0; max-width: 100%; }
.sh-body .box b { overflow: hidden; text-overflow: ellipsis; }

/* dashboard numbers: six in a row on a wide screen, four on a laptop, three on a phone */
.kpis.dash { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis.dash .kpi { padding: 10px 12px; gap: 10px; }
.kpis.dash .kpi dd { font-size: 18px; line-height: 24px; }
@media (max-width: 1300px) { .kpis.dash { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mbar { display: none; }
@media (max-width: 860px) {
  .kpis.dash { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kpis.dash .kpi { padding: 8px; }
  .kpis.dash .kpi .kico { display: none; }
  .kpis.dash .kpi dt { font-size: 11px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kpis.dash .kpi dd { font-size: 14px; line-height: 20px; }
  /* a window opened on a phone fills the whole width (it used to keep a gap on the right) */
  .sheet, .sheet.form-sheet, .sheet.dlg { left: 0; right: 0; top: 28px; bottom: 0; width: 100%; max-width: none; max-height: none; transform: none; border-radius: 20px 20px 0 0; }
  .top .btn.primary.sm { width: 32px; height: 32px; padding: 0; justify-content: center; }
  /* phone: shortcuts bar at the bottom */
  .app { grid-template-rows: 48px minmax(0, 1fr) auto; }
  .mbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .mbar button { display: grid; justify-items: center; gap: 2px; height: 48px; align-content: center; border: 0; background: none; color: var(--text-2); border-radius: 8px; cursor: pointer; }
  .mbar button small { font-size: 10px; line-height: 12px; }
  .mbar button svg { width: 20px; height: 20px; }
  .mbar .mbar-add { width: 44px; height: 44px; justify-self: center; border-radius: 50%; background: var(--accent); color: #fff; }
  .mbar button:active { background: var(--raised, rgba(0, 0, 0, .05)); }
  .toasts { bottom: 72px; }
}
