/* NexFit · merchant & platform portal — enterprise design system */
:root {
  /* surfaces */
  --canvas: #F8FAFC;
  --card: #FFFFFF;
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0F172A;
  /* text */
  --text: #0F172A;
  --ink: #111111;          /* primary (buttons, active states) */
  --ink-2: #475569;        /* secondary text */
  --muted: #64748B;
  --faint: #94A3B8;
  /* lines */
  --border: rgba(0, 0, 0, .08);
  --line: rgba(0, 0, 0, .06);
  --line-2: #E2E8F0;
  /* semantic (states only) */
  --ok: #16A34A;   --ok-bg: #F0FDF4;   --ok-line: #BBF7D0;
  --warn: #D97706; --warn-bg: #FFFBEB; --warn-line: #FDE68A;
  --bad: #DC2626;  --bad-bg: #FEF2F2;  --bad-line: #FECACA;
  --info: #2563EB; --info-bg: #EFF6FF; --info-line: #BFDBFE;
  /* legacy aliases kept neutral so any remaining reference stays on-system */
  --canvas-2: #F1F5F9;
  --butter: #F1F5F9;
  --butter-ink: #475569;
  /* shape */
  --radius: 12px;
  --radius-lg: 16px;
  --radius-input: 8px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, .04), 0 8px 10px -6px rgba(0, 0, 0, .02);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, .18), 0 8px 16px -8px rgba(15, 23, 42, .08);
  --focus: 0 0 0 2px #fff, 0 0 0 4px #111111;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html, body { background: var(--canvas); }
body { min-height: 100vh; color: var(--text); font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; font-feature-settings: "cv11", "ss01"; }
[hidden] { display: none !important; }
::selection { background: #E2E8F0; }
.num, .light-num, .tbl td.r, .tbl td.num { font-variant-numeric: tabular-nums; }
.light-num { font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.eyebrow, .nav-label { font-size: 12px; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
button, [role="button"] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.ico { color: var(--slate-500); font-size: 14px; }

/* headings */
.page-title { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.page-title em { font-style: normal; color: inherit; }
.h-title { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.section-title { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }

/* wordmark */
.wordmark { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.wm-name { font-size: 20px; font-weight: 700; letter-spacing: -.03em; color: var(--text); }
.wm-by { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.wordmark-inv .wm-name { color: #fff; }
.wordmark-inv .wm-by { color: #94A3B8; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--canvas); }
.boot-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--slate-200); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* legacy decorative classes → neutral placeholders (no gradients, no grain) */
.mesh, .ph { background-color: var(--slate-100); background-image: none; }
.mesh::after { content: none; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; }
.login-art { background: #0B0F17; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.login-headline { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -.02em; color: #fff; }
.login-points { display: flex; flex-direction: column; gap: 16px; }
.login-points li { display: flex; gap: 12px; align-items: baseline; font-size: 16px; line-height: 24px; color: #CBD5E1; }
.login-points i { font-size: 12px; color: #94A3B8; width: 16px; }
.login-form { display: grid; place-items: center; padding: 32px 24px; background: #fff; }
.login-card { width: 100%; max-width: 400px; }
.login-mobile-mark { display: none; margin-bottom: 32px; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-mobile-mark { display: flex; }
  .login-form { min-height: 100vh; place-items: start center; padding-top: 48px; }
}

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, #fff 247px, rgba(0,0,0,.08) 247px, rgba(0,0,0,.08) 248px, transparent 248px); }
#view { display: block; padding-top: 8px; outline: none; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px 16px; display: flex; flex-direction: column; gap: 16px; background: #fff; border-right: 1px solid var(--border); }
.brand { padding: 0 8px 8px; }
.brand-mark { display: none; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav-label { padding: 16px 12px 8px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.nav a i { width: 16px; text-align: center; font-size: 14px; color: var(--slate-500); transition: color .15s; }
.nav a:hover { background: var(--slate-100); color: var(--text); }
.nav a.active { background: var(--ink); color: #fff; }
.nav a.active i { color: #fff; }
.nav a .tag { margin-left: auto; }
.plan-card { border-radius: var(--radius); padding: 16px; background: #fff; border: 1px solid var(--border); }
.plan-card .btn { height: 36px; }
.main { min-width: 0; padding: 0 32px 48px; }
.topbar { display: flex; align-items: center; gap: 12px; height: 72px; margin-bottom: 8px; position: sticky; top: 0; z-index: 30; background: rgba(248, 250, 252, .9); backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); margin-left: -32px; margin-right: -32px; padding: 0 32px; }
.store-switch { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 999px; height: 40px; padding: 0 14px 0 6px; min-width: 0; }
.store-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.store-switch .store-dot { width: 28px; height: 28px; }
.store-switch .store-meta .truncate { font-size: 14px; }
.search { flex: 1; max-width: 400px; position: relative; }
.search input { width: 100%; height: 40px; border-radius: var(--radius-input); border: 1px solid var(--line-2); background: #fff; padding: 0 40px 0 38px; font-size: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,17,17,.08); }
.search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--slate-500); font-size: 14px; pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 12px "Inter", sans-serif; color: var(--muted); border: 1px solid var(--line-2); background: var(--slate-50); border-radius: 6px; padding: 0 6px; line-height: 20px; }
.search.inline-search { display: block; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--border); color: var(--slate-500); position: relative; flex: none; font-size: 16px; transition: background .15s, color .15s, border-color .15s; }
.icon-btn:hover { background: var(--slate-50); color: var(--text); }
.icon-btn.sm { width: 32px; height: 32px; font-size: 14px; border-color: transparent; background: transparent; }
.icon-btn.sm:hover { background: var(--slate-100); color: var(--text); }
.icon-btn.sm.danger:hover { background: var(--bad-bg); color: var(--bad); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid #fff; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; background: var(--slate-100); color: var(--text); border: 1px solid var(--border); }
.avatar.sm { width: 36px; height: 36px; font-size: 12px; }
button.avatar:hover { background: var(--slate-200); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 16px 0 24px; }
.page-head p.muted { color: var(--ink-2); font-size: 16px; line-height: 24px; margin-top: 4px; }

/* mobile dock */
.dock { display: none; }
.menu-btn { display: none; }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; background: none; }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-105%); transition: transform .2s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { padding: 0 16px 112px; }
  .topbar { margin-left: -16px; margin-right: -16px; padding: 0 16px; height: 64px; }
  .menu-btn { display: grid; }
  .dock { display: flex; position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px; box-shadow: var(--shadow-lg); }
  .dock a, .dock button { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--slate-500); font-size: 16px; }
  .dock a.active { background: var(--ink); color: #fff; }
}
@media (max-width: 640px) {
  .search { display: none; }
  .search.inline-search { display: block; }
  .store-switch .store-meta { display: none; }
  .store-switch { padding: 0 6px; }
  .topbar { gap: 8px; }
  .hide-sm { display: none !important; }
  .page-title { font-size: 24px; line-height: 32px; }
}
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 65; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.card.flat { box-shadow: none; }
.card.toolbar { padding: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.card-sub { font-size: 14px; line-height: 20px; color: var(--muted); margin-top: 2px; }
.note { background: var(--slate-50); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--ink-2); }
.note > i { color: var(--slate-500); }
.tile { border-radius: var(--radius); padding: 16px; background: var(--slate-50); border: 1px solid var(--line); }
label.tile { transition: border-color .15s, background .15s; }
label.tile:hover { border-color: var(--slate-300); }
.tile-row { background: var(--slate-50); border: 1px solid var(--line); }
.tile-row:hover { background: var(--slate-100); }
.swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }

.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { border-radius: var(--radius); padding: 16px 20px; background: #fff; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kpi.hl { border-top: 2px solid var(--ink); }
.kpi .v { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -.02em; }
.kpi .sub { font-size: 12px; line-height: 16px; color: var(--muted); }
.card .kpi-row .kpi { box-shadow: none; }
@media (max-width: 1180px) { .kpi .v { font-size: 24px; line-height: 32px; } }
@media (max-width: 640px) { .kpi-row { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; } .kpi { padding: 12px 16px; } }

.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ok); font-variant-numeric: tabular-nums; }
.delta i { font-size: 10px; }
.delta.down { color: var(--bad); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .1s; border: 1px solid transparent; }
.btn i { font-size: 14px; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2A2A2A; }
.btn-ghost { background: #fff; color: var(--text); border-color: rgba(0,0,0,.12); }
.btn-ghost:hover:not(:disabled) { background: var(--slate-50); border-color: rgba(0,0,0,.18); }
.btn-ghost .fa-solid, .btn-ghost .fa-regular { color: var(--slate-500); }
.btn-soft { background: var(--slate-100); color: var(--text); }
.btn-soft:hover:not(:disabled) { background: var(--slate-200); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #B91C1C; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn-sm i { font-size: 12px; }
.btn-xs { height: 28px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 16px; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.link { font-weight: 500; color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--slate-300); }
.link:hover { text-decoration-color: currentColor; }

/* ---------- tags & chips ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; background: var(--slate-100); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag i { font-size: 10px; color: var(--slate-500); }
.tag.tag-sm { height: 20px; padding: 0 6px; font-size: 12px; }
.tag.tag-outline { background: #fff; border-color: var(--line-2); }
.tag.ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag.ink i { color: #fff; }
.tag.ok { background: var(--ok-bg); color: #15803D; border-color: var(--ok-line); }
.tag.warn { background: var(--warn-bg); color: #B45309; border-color: var(--warn-line); }
.tag.bad { background: var(--bad-bg); color: #B91C1C; border-color: var(--bad-line); }
.tag.info { background: var(--info-bg); color: #1D4ED8; border-color: var(--info-line); }
.tag.ok i, .tag.warn i, .tag.bad i, .tag.info i { color: currentColor; }
/* legacy colour modifiers collapse to neutral */
.tag.yellow, .tag.lav, .tag.sky, .tag.pink, .tag.peach { background: var(--slate-100); color: var(--ink-2); border-color: var(--line); }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.tag-float { background: rgba(255,255,255,.92); border-color: rgba(0,0,0,.06); color: var(--text); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 500; background: #fff; border: 1px solid var(--line-2); color: var(--ink-2); transition: background .15s, color .15s, border-color .15s; }
.chip:hover { background: var(--slate-50); color: var(--text); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.chip-sm { height: 28px; font-size: 12px; }
.seg { display: inline-flex; background: var(--slate-100); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background .15s, color .15s; }
.seg button:hover:not(.on) { color: var(--text); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.06); }

/* thumbs */
.thumb { width: 40px; height: 40px; border-radius: 8px; flex: none; overflow: hidden; background-color: var(--slate-100); background-size: cover; background-position: center top; display: inline-grid; place-items: center; color: var(--slate-400); font-size: 14px; border: 1px solid var(--line); }
.thumb.lg { width: 56px; height: 56px; border-radius: 12px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 14px; font-weight: 500; color: var(--text); }
.hint { font-size: 12px; line-height: 16px; color: var(--muted); }
.input, .select, .textarea { width: 100%; height: 40px; border-radius: var(--radius-input); border: 1px solid var(--line-2); background: #fff; padding: 0 12px; font-size: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover:not(:disabled), .select:hover:not(:disabled), .textarea:hover:not(:disabled) { border-color: var(--slate-300); }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%2364748B' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.select.select-sm { height: 32px; font-size: 14px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,17,17,.08); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--slate-50); color: var(--muted); }
.input.pill { border-radius: var(--radius-input); }
.color-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: var(--radius-input); padding: 4px 8px 4px 4px; height: 40px; background: #fff; }
.color-input:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,17,17,.08); }
.color-input input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; border-radius: 6px; overflow: hidden; }
.color-input input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.08); border-radius: 6px; }
.color-input input[type=text] { border: 0; outline: 0; flex: 1; min-width: 0; font: 500 14px "Inter", sans-serif; text-transform: uppercase; font-variant-numeric: tabular-nums; color: var(--text); background: transparent; }
.switch { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--slate-200); transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.dropzone { border: 1px dashed var(--slate-300); border-radius: var(--radius); padding: 16px; display: flex; gap: 16px; align-items: center; background: var(--slate-50); transition: border-color .15s, background .15s; }
.dropzone.drag { border-color: var(--ink); background: var(--slate-100); }

/* ---------- lists & tables ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; transition: background .15s; }
.list-row:hover { background: var(--slate-50); }
.list-row + .list-row { margin-top: 2px; }
.round-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 14px; background: var(--slate-100); color: var(--slate-500); border: 1px solid var(--line); }
.table-wrap { overflow: auto; border-radius: 8px; max-height: 640px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { position: sticky; top: 0; z-index: 2; background: #fff; text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--slate-500); font-weight: 500; padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text); }
.tbl td.muted { color: var(--muted); }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--slate-50); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:focus-visible { background: var(--slate-50); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.bar { height: 6px; background: var(--slate-200); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.bar.lg { height: 12px; }
.meter { height: 8px; border-radius: 999px; background: var(--slate-200); overflow: hidden; position: relative; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--ink); transition: width .2s var(--ease); }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }

/* product grid */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.pcard { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 0; box-shadow: var(--shadow); text-align: left; transition: border-color .15s, box-shadow .15s; display: flex; flex-direction: column; overflow: hidden; }
.pcard:hover { border-color: rgba(0,0,0,.16); box-shadow: 0 12px 28px -8px rgba(15,23,42,.12); }
.pcard .img { aspect-ratio: 4/5; background-color: var(--slate-100); background-size: cover; background-position: center top; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.pcard .img .tag { position: absolute; top: 8px; left: 8px; }
.pcard .img .st { position: absolute; top: 8px; right: 8px; left: auto; }
.pcard .body { padding: 12px 14px 14px; }
.pcard.archived .img { filter: grayscale(1); opacity: .55; }

/* code */
.code { position: relative; background: #0B0F17; color: #CBD5E1; border-radius: var(--radius); padding: 16px 20px; font: 13px/1.7 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; border: 1px solid #1E293B; }
.code .copy { position: absolute; top: 10px; right: 10px; background: #1E293B; color: #E2E8F0; border-color: #334155; font-family: "Inter", sans-serif; }
.code .copy:hover { background: #334155; }
.code .c { color: #64748B; }
.code .s { color: #F8FAFC; }
.code .k { color: #fff; font-weight: 600; }
.tabs { display: flex; gap: 2px; background: var(--slate-100); padding: 4px; border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: background .15s, color .15s; }
.tabs button i { color: var(--slate-500); }
.tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.06); }
.tabs button.on i { color: var(--text); }
.keybox { font: 13px/1.5 ui-monospace, Menlo, monospace; background: var(--slate-50); border: 1px solid var(--line-2); border-radius: var(--radius-input); padding: 8px 8px 8px 12px; word-break: break-all; display: flex; gap: 8px; align-items: center; justify-content: space-between; color: var(--text); }
.key-ref li { color: var(--ink-2); }
.key-ref li i { color: var(--slate-500); }
.key-ref li b { color: var(--text); font-weight: 600; }

/* ---------- states ---------- */
.skel { background: linear-gradient(90deg, #F1F5F9 0, #F8FAFC 40%, #F1F5F9 80%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { border-radius: var(--radius); padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--slate-50); border: 1px dashed var(--slate-300); }
.empty .ic { width: 40px; height: 40px; border-radius: 8px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; font-size: 16px; color: var(--slate-500); margin-bottom: 4px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); }
.error-state { border-radius: var(--radius); padding: 24px; text-align: center; background: var(--bad-bg); border: 1px solid var(--bad-line); color: #B91C1C; }

/* ---------- overlays ---------- */
.toasts { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: #fff; color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--ok); border-radius: var(--radius); padding: 12px 16px 12px 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: min(440px, calc(100vw - 32px)); animation: toastIn .2s var(--ease); }
.toast .ti { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex: none; background: var(--ok-bg); color: var(--ok); }
.toast.error { border-left-color: var(--bad); }
.toast.error .ti { background: var(--bad-bg); color: var(--bad); }
.toast.info { border-left-color: var(--info); }
.toast.info .ti { background: var(--info-bg); color: var(--info); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .18s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 1024px) { .toasts { left: 16px; right: 16px; bottom: 92px; align-items: center; } }

.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 16px; animation: fade .18s; }
.modal { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .2s var(--ease); }
.modal.wide { max-width: 640px; }
.modal-head { border-bottom: 1px solid var(--line); }
@keyframes pop { from { opacity: 0; transform: scale(.98) translateY(4px); } }
.drawer-back { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .35); animation: fade .18s; }
.drawer { position: fixed; z-index: 91; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #fff; border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn .2s var(--ease); }
.drawer-head { padding: 24px 24px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 24px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; background: var(--slate-50); }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } }
@media (max-width: 640px) { .drawer { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-left: 0; } }

.menu { position: absolute; z-index: 80; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; animation: pop .15s var(--ease); }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; text-align: left; color: var(--text); }
.menu a i, .menu button i { color: var(--slate-500); }
.menu a:hover, .menu button:hover { background: var(--slate-100); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

/* chat */
.chat { position: fixed; z-index: 95; right: 24px; bottom: 24px; width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100vh - 48px)); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .2s var(--ease); }
.chat-head { padding: 20px; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--slate-50); }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: #fff; border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.bubble .src { display: block; margin-top: 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; color: var(--faint); }
.chat form { border-top: 1px solid var(--line); padding-top: 12px !important; }
#chat-sugg { background: var(--slate-50); padding-top: 4px; padding-bottom: 12px; }
.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 1px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }
@media (max-width: 640px) { .chat { right: 8px; left: 8px; bottom: 8px; width: auto; height: 82vh; } }

/* funnel */
.funnel-step { display: grid; grid-template-columns: 140px 1fr 90px; gap: 16px; align-items: center; }
.funnel-bar { height: 40px; border-radius: 8px; display: flex; align-items: center; padding: 0 12px; font-weight: 600; font-size: 14px; min-width: 64px; }
@media (max-width: 640px) { .funnel-step { grid-template-columns: 90px 1fr 56px; gap: 8px; } }

/* kiosk preview (mirrors the merchant's own kiosk branding) */
.kiosk-prev { border-radius: var(--radius-lg); overflow: hidden; border: 6px solid #0B0F17; aspect-ratio: 9/14; max-width: 260px; margin: 0 auto; display: flex; flex-direction: column; background: #F8FAFC; }
.kiosk-prev .mesh { background-color: #E2E8F0; }

/* bulk photo rows */
.bulk-row { background: var(--slate-50); border: 1px solid var(--line); }

/* plan cards */
.plan { border-radius: var(--radius); padding: 24px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; position: relative; }
.plan.current { border: 2px solid var(--ink); padding: 23px; }
.plan .price { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -.02em; }
.plan ul li { display: flex; gap: 8px; align-items: baseline; font-size: 14px; padding: 4px 0; color: var(--ink-2); }
.plan ul li i { font-size: 12px; color: var(--ok); }

.fade-in { animation: fadeUp .2s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
