@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #f1f5f9;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-soft: #f1f5f9;
  --text: #0f172a;
  --text-dim: #475569;
  --text-muted: #94a3b8;
  --primary: #16a34a;
  --primary-hover: #15803d;
  --primary-soft: #dcfce7;
  --accent: #2563eb;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warn: #ea580c;
  --warn-soft: #ffedd5;
  --info: #0284c7;
  --info-soft: #dbeafe;
  --sidebar: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-text: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 0 4px var(--primary-soft);
  --radius: 12px;
  --radius-sm: 8px;
}

/* ===== Dark theme ===== */
html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #0f172a;
  --bg-muted: #1e293b;
  --surface: #111827;
  --border: #1f2a3c;
  --border-soft: #1e293b;
  --text: #f1f5f9;
  --text-dim: #cbd5e1;
  --text-muted: #64748b;
  --primary-soft: rgba(34, 197, 94, 0.18);
  --warn-soft: rgba(234, 88, 12, 0.2);
  --danger-soft: rgba(220, 38, 38, 0.2);
  --info-soft: rgba(2, 132, 199, 0.2);
  --sidebar: #060b16;
  --sidebar-hover: #111827;
  --sidebar-text: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* ===== Buttons ===== */
.btn, button {
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none !important;
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.btn:hover, button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(22, 163, 74, 0.35);
}
.btn:active, button:active { transform: translateY(0) scale(0.98); transition-duration: 0.08s; }
.btn.ghost, button.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn.ghost:hover, button.ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn.dark, button.dark { background: var(--text); color: var(--bg); }
.btn.dark:hover, button.dark:hover { background: var(--text-dim); }
.btn.danger, button.danger { background: var(--danger); }
.btn.danger:hover, button.danger:hover { background: #b91c1c; }
.btn.lg, button.lg { padding: 14px 28px; font-size: 16px; border-radius: 12px; }
.btn.sm, button.sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn.block, button.block { width: 100%; }

/* Shimmer effect on primary button */
.btn.lg::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.55s ease;
}
.btn.lg:hover::after { left: 100%; }

/* ===== Inputs ===== */
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}
input[disabled], input[readonly] { background: var(--bg-soft); color: var(--text-dim); }
input[type="checkbox"] { width: auto; }

label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-dim); }
.field { margin-bottom: 16px; }

/* ===== Layout helpers ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.muted { color: var(--text-muted); font-size: 13px; }
.dim { color: var(--text-dim); }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.25s var(--ease-smooth);
  animation: cardFadeIn 0.55s var(--ease) backwards;
}
.card h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.card:hover { box-shadow: var(--shadow); }

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger card entrance when in a grid */
.grid > .card:nth-child(1), .grid > .stat:nth-child(1) { animation-delay: 0.02s; }
.grid > .card:nth-child(2), .grid > .stat:nth-child(2) { animation-delay: 0.06s; }
.grid > .card:nth-child(3), .grid > .stat:nth-child(3) { animation-delay: 0.10s; }
.grid > .card:nth-child(4), .grid > .stat:nth-child(4) { animation-delay: 0.14s; }
.grid > .card:nth-child(5), .grid > .stat:nth-child(5) { animation-delay: 0.18s; }
.grid > .card:nth-child(6), .grid > .stat:nth-child(6) { animation-delay: 0.22s; }
.grid > .card:nth-child(7), .grid > .stat:nth-child(7) { animation-delay: 0.26s; }
.grid > .card:nth-child(8), .grid > .stat:nth-child(8) { animation-delay: 0.30s; }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge.ok { background: var(--primary-soft); color: #15803d; }
.badge.warn { background: var(--warn-soft); color: #c2410c; }
.badge.err { background: var(--danger-soft); color: #b91c1c; }
.badge.info { background: var(--info-soft); color: #1e40af; }
html[data-theme="dark"] .badge.ok { color: #86efac; }
html[data-theme="dark"] .badge.warn { color: #fdba74; }
html[data-theme="dark"] .badge.err { color: #fca5a5; }
html[data-theme="dark"] .badge.info { color: #93c5fd; }

/* ===== Tables ===== */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
th { color: var(--text-muted); font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; background: var(--bg-soft); }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--bg-soft); }
.card table { margin: -22px; width: calc(100% + 44px); }
.card table th:first-child, .card table td:first-child { padding-left: 22px; }
.card table th:last-child, .card table td:last-child { padding-right: 22px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== Nav / Shell ===== */
.nav {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 20px 0;
  height: 100vh;
  width: 240px;
  position: fixed;
  left: 0; top: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(0,0,0,0.5);
  transition: transform 0.22s ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.nav h1 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  padding: 0 22px 18px;
  margin: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.1s;
}
.nav a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav a.active {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--primary);
}
.nav a .ico { font-size: 16px; width: 20px; text-align: center; }

.nav .theme-toggle {
  margin: 10px 18px 10px;
  background: var(--sidebar-hover);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.nav .theme-toggle:hover { background: #334155; transform: none; }

.main {
  margin-left: 240px;
  padding: 28px 32px;
  min-height: 100vh;
  background: var(--bg-soft);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}
.topbar h2 { font-size: 24px; font-weight: 700; color: var(--text); }

/* Mobile hamburger for admin/dashboard */
.menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  background: var(--sidebar);
  color: #fff;
  border: 0;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow);
}
.menu-toggle:hover { background: var(--sidebar-hover); transform: none; }

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.nav-backdrop.open { opacity: 1; pointer-events: auto; }

/* ===== Stat cards ===== */
.stat {
  background: var(--surface);
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.25s var(--ease-smooth);
  animation: cardFadeIn 0.55s var(--ease) backwards;
}
.stat:hover { transform: translateY(-4px); box-shadow: 0 16px 32px -10px rgba(15, 23, 42, 0.15); border-color: var(--primary); }
.stat:hover .stat-icon { transform: scale(1.08) rotate(-6deg); }
.stat .stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat.blue .stat-icon { background: var(--info-soft); color: var(--info); }
.stat.orange .stat-icon { background: var(--warn-soft); color: var(--warn); }
.stat.red .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat.purple .stat-icon { background: rgba(124,58,237,0.15); color: #7c3aed; }
.stat .stat-body .label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
.stat .stat-body .value { font-size: 26px; font-weight: 700; color: var(--text); margin-top: 2px; }

/* ===== Auth / Modal ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at top, var(--primary-soft) 0%, var(--bg-soft) 40%, var(--bg) 100%);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: cardFadeIn 0.55s ease-out;
}
.auth-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}
.auth-card .sub { text-align: center; color: var(--text-muted); margin-bottom: 26px; font-size: 14px; }

.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: #111827; color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  font-size: 14px;
  font-weight: 500;
  animation: slidein 0.2s ease-out;
}
.toast.ok { background: #15803d; }
.toast.err { background: #991b1b; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-bg {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  padding: 16px;
  animation: fadein 0.15s ease-out;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: cardFadeIn 0.25s ease-out;
}
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 18px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ===== Marketing / Landing ===== */
.mk-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.mk-header .inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.mk-logo { font-size: 18px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.mk-nav-links { display: flex; gap: 26px; font-size: 14px; }
.mk-nav-links a { color: var(--text-dim); font-weight: 500; }
.mk-nav-links a:hover { color: var(--text); text-decoration: none; }

.mk-theme-btn {
  background: transparent !important;
  color: var(--text-dim) !important;
  border: 1px solid var(--border) !important;
  width: 36px; height: 36px;
  padding: 0 !important;
  border-radius: 10px;
  font-size: 18px;
}
.mk-theme-btn:hover { background: var(--bg-soft) !important; transform: none; }

.mk-menu-btn {
  display: none;
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  width: 40px; height: 40px;
  padding: 0 !important;
  border-radius: 10px;
  font-size: 20px;
}
.mk-menu-btn:hover { background: var(--bg-soft) !important; transform: none; }
.mk-mobile-menu {
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
}
.mk-mobile-menu.open { display: block; animation: slidein 0.18s ease-out; }
.mk-mobile-menu a { display: block; padding: 10px 0; color: var(--text-dim); font-weight: 500; border-bottom: 1px solid var(--border-soft); }
.mk-mobile-menu a:last-child { border-bottom: 0; }

.hero {
  position: relative;
  padding: 100px 20px 80px;
  text-align: center;
  background: linear-gradient(180deg, #f6f9f8 0%, #edf7f4 55%, var(--bg) 100%);
  overflow: hidden;
  isolation: isolate;
}
/* Grid-paper pattern, masked to fade at edges */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 118, 110, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center center;
  mask-image: radial-gradient(ellipse 90% 75% at center, #000 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at center, #000 40%, transparent 90%);
  pointer-events: none;
  z-index: -1;
}
/* Animated teal + sky gradient mesh */
.hero::after {
  content: '';
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 640px 420px at 85% 18%, rgba(20, 184, 166, 0.28), transparent 65%),
    radial-gradient(ellipse 520px 360px at 8% 70%, rgba(59, 130, 246, 0.14), transparent 65%),
    radial-gradient(ellipse 420px 260px at 60% 85%, rgba(16, 163, 74, 0.12), transparent 65%);
  filter: blur(4px);
  animation: meshDrift 22s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}
@keyframes meshDrift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2%, 2%) scale(1.04); }
  100% { transform: translate(2%, -1%) scale(0.98); }
}

html[data-theme="dark"] .hero {
  background: linear-gradient(180deg, #0b1220 0%, #0f1724 55%, var(--bg) 100%);
}
html[data-theme="dark"] .hero::before {
  background-image:
    linear-gradient(rgba(20, 184, 166, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.10) 1px, transparent 1px);
}
html[data-theme="dark"] .hero::after {
  background:
    radial-gradient(ellipse 640px 420px at 85% 18%, rgba(20, 184, 166, 0.24), transparent 65%),
    radial-gradient(ellipse 520px 360px at 8% 70%, rgba(59, 130, 246, 0.18), transparent 65%),
    radial-gradient(ellipse 420px 260px at 60% 85%, rgba(16, 163, 74, 0.16), transparent 65%);
}
.hero h1 {
  font-size: 54px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 820px;
  margin: 0 auto 20px;
  animation: fadeUp 0.7s ease-out;
}
.hero .sub {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 32px;
  animation: fadeUp 0.7s ease-out 0.1s backwards;
}
.hero .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; animation: fadeUp 0.7s ease-out 0.2s backwards; }
.hero .trust { color: var(--text-muted); font-size: 13px; animation: fadeUp 0.7s ease-out 0.3s backwards; }
.hero .chat-mock { animation: fadeUp 0.8s ease-out 0.4s backwards; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.section { padding: 80px 20px; position: relative; }
.section.alt { background: var(--bg-soft); }

/* Scroll reveal for sections */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 42px; }
.section-head .eyebrow { color: var(--primary); font-weight: 600; font-size: 13px; letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 10px; }
.section-head h2 { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.section-head p { color: var(--text-dim); margin-top: 12px; font-size: 16px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.25s var(--ease-smooth);
  animation: cardFadeIn 0.55s var(--ease) backwards;
}
.feature-grid .feature:nth-child(1) { animation-delay: 0.05s; }
.feature-grid .feature:nth-child(2) { animation-delay: 0.10s; }
.feature-grid .feature:nth-child(3) { animation-delay: 0.15s; }
.feature-grid .feature:nth-child(4) { animation-delay: 0.20s; }
.feature-grid .feature:nth-child(5) { animation-delay: 0.25s; }
.feature-grid .feature:nth-child(6) { animation-delay: 0.30s; }
.feature-grid .feature:nth-child(7) { animation-delay: 0.35s; }
.feature-grid .feature:nth-child(8) { animation-delay: 0.40s; }
.feature-grid .feature:nth-child(9) { animation-delay: 0.45s; }
.feature:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px -14px rgba(15, 23, 42, 0.18), 0 6px 12px -6px rgba(16, 163, 74, 0.12);
  border-color: var(--primary);
}
html[data-theme="dark"] .feature:hover { box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6); }
.feature:hover .f-ico { transform: scale(1.1) rotate(-8deg); }
.feature .f-ico {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.feature h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.feature p { color: var(--text-dim); font-size: 14px; line-height: 1.55; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  animation: cardFadeIn 0.5s ease-out backwards;
}
.steps .step:nth-child(1) { animation-delay: 0.1s; }
.steps .step:nth-child(2) { animation-delay: 0.2s; }
.steps .step:nth-child(3) { animation-delay: 0.3s; }
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.step .step-num {
  position: absolute;
  top: -14px;
  left: 24px;
  background: var(--text);
  color: var(--bg);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.step h3 { font-size: 17px; font-weight: 700; margin: 10px 0 8px; }
.step p { color: var(--text-dim); font-size: 14px; }

.chat-mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  max-width: 380px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
.chat-mock .bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  margin-bottom: 8px;
  max-width: 80%;
  line-height: 1.5;
  animation: bubbleIn 0.4s ease-out backwards;
}
.chat-mock .bubble:nth-child(1) { animation-delay: 0.1s; }
.chat-mock .bubble:nth-child(2) { animation-delay: 0.2s; }
.chat-mock .bubble:nth-child(3) { animation-delay: 0.3s; }
.chat-mock .bubble:nth-child(4) { animation-delay: 0.4s; }
.chat-mock .bubble:nth-child(5) { animation-delay: 0.5s; }
.chat-mock .bubble:nth-child(6) { animation-delay: 0.6s; }
.chat-mock .bubble:nth-child(7) { animation-delay: 0.7s; }
.chat-mock .bubble:nth-child(8) { animation-delay: 0.8s; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-mock .bot { background: var(--bg-soft); color: var(--text); border-top-left-radius: 4px; }
.chat-mock .user { background: #dcf8c6; color: #111827; margin-left: auto; border-top-right-radius: 4px; }
html[data-theme="dark"] .chat-mock .user { background: #0e5034; color: #e6ffef; }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.price {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  animation: cardFadeIn 0.5s ease-out backwards;
}
.pricing .price:nth-child(1) { animation-delay: 0.1s; }
.pricing .price:nth-child(2) { animation-delay: 0.2s; }
.pricing .price:nth-child(3) { animation-delay: 0.3s; }
.price:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.price.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  transform: scale(1.02);
}
.price.featured:hover { transform: scale(1.02) translateY(-6px); }
.price .name { font-size: 14px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.4px; }
.price .amount { font-size: 40px; font-weight: 800; margin: 8px 0; letter-spacing: -0.02em; }
.price .amount .per { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.price ul { list-style: none; margin: 18px 0 22px; }
.price li { padding: 6px 0; color: var(--text-dim); font-size: 14px; display: flex; gap: 8px; }
.price li::before { content: '✓'; color: var(--primary); font-weight: 700; }
.price .btn { margin-top: auto; }

.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  animation: cardFadeIn 0.4s ease-out backwards;
}
.faq details:nth-child(1) { animation-delay: 0.05s; }
.faq details:nth-child(2) { animation-delay: 0.10s; }
.faq details:nth-child(3) { animation-delay: 0.15s; }
.faq details:nth-child(4) { animation-delay: 0.20s; }
.faq details:nth-child(5) { animation-delay: 0.25s; }
.faq details:nth-child(6) { animation-delay: 0.30s; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--text-muted); font-size: 20px; font-weight: 400; transition: transform 0.2s; }
.faq details[open] summary::after { content: '–'; }
.faq details[open] { border-color: var(--primary); box-shadow: var(--shadow); }
.faq p { color: var(--text-dim); margin-top: 12px; font-size: 14px; line-height: 1.6; }

.mk-footer {
  background: var(--text);
  color: var(--text-muted);
  padding: 50px 20px 30px;
}
html[data-theme="dark"] .mk-footer { background: #060b16; }
.mk-footer .inner { max-width: 1140px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.mk-footer h4 { color: var(--bg); font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 14px; }
html[data-theme="dark"] .mk-footer h4 { color: #fff; }
.mk-footer a { color: #94a3b8; display: block; padding: 4px 0; font-size: 14px; }
.mk-footer a:hover { color: #fff; }
.mk-footer .brand { font-size: 18px; font-weight: 700; color: var(--bg); margin-bottom: 12px; }
html[data-theme="dark"] .mk-footer .brand { color: #fff; }
.mk-footer .bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 40px; padding-top: 22px; font-size: 13px; color: #64748b; text-align: center; }

/* ===== Store ===== */
.store-wrap { max-width: 1040px; margin: 0 auto; padding: 30px 20px 80px; }
.store-head { text-align: center; margin-bottom: 36px; }
.store-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.store-head p { color: var(--text-dim); margin-top: 8px; }
.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s, border-color 0.25s;
  animation: cardFadeIn 0.4s ease-out backwards;
}
.platform-card:hover { transform: translateY(-4px) scale(1.02); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.platform-card:hover .emoji { transform: scale(1.15) rotate(-6deg); }
.platform-card .emoji { font-size: 32px; margin-bottom: 8px; transition: transform 0.3s; }
.platform-card .name { font-weight: 700; font-size: 16px; }
.platform-card .count { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.service-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 0.1s, padding-left 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.service-row:hover { background: var(--bg-soft); padding-left: 22px; }
.service-row .meta { color: var(--text-muted); font-size: 12px; margin-top: 3px; }
.service-row .price { font-weight: 700; color: var(--primary); font-size: 15px; white-space: nowrap; }

/* ===== CTA card (theme-aware) ===== */
.cta-card {
  background: linear-gradient(135deg, #ecfdf5, #dbeafe);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 30px;
  text-align: center;
  box-shadow: var(--shadow);
}
.cta-card h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: #0f172a;
  line-height: 1.2;
}
.cta-card p { color: #334155; margin-bottom: 26px; font-size: 16px; }
html[data-theme="dark"] .cta-card {
  background: linear-gradient(135deg, rgba(16, 163, 74, 0.18), rgba(37, 99, 235, 0.18));
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .cta-card h2 { color: #f1f5f9; }
html[data-theme="dark"] .cta-card p { color: #cbd5e1; }
@media (max-width: 768px) { .cta-card { padding: 40px 22px; } .cta-card h2 { font-size: 24px; } }

/* ===== Legal / content pages ===== */
.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 50px 22px 80px;
  line-height: 1.75;
}
.legal-page h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.legal-page .legal-meta { color: var(--text-muted); font-size: 13px; margin-bottom: 30px; }
.legal-page h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 34px 0 12px;
  letter-spacing: -0.01em;
}
.legal-page h3 { font-size: 17px; font-weight: 700; margin: 22px 0 8px; }
.legal-page p, .legal-page li { color: var(--text-dim); font-size: 15px; }
.legal-page p { margin-bottom: 12px; }
.legal-page ul, .legal-page ol { padding-left: 22px; margin-bottom: 14px; }
.legal-page li { margin-bottom: 6px; }
.legal-page strong { color: var(--text); }
.legal-page a { color: var(--primary); }
.legal-page hr { border: 0; border-top: 1px solid var(--border); margin: 30px 0; }
@media (max-width: 768px) {
  .legal-page { padding: 30px 16px 60px; }
  .legal-page h1 { font-size: 28px; }
  .legal-page h2 { font-size: 19px; }
}

/* ===== Services group/rows ===== */
.svc-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: cardFadeIn 0.4s ease-out backwards;
}
.svc-group-head {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}
.svc-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
  transition: background 0.1s;
}
.svc-row:hover { background: var(--bg-soft); }
.svc-row:last-child { border-bottom: 0; }
.svc-row-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.svc-name { font-weight: 500; font-size: 14px; }
.svc-row-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; font-size: 12px; }
.svc-row-price { text-align: right; min-width: 110px; }
.svc-price-sell { font-weight: 700; font-size: 15px; color: var(--primary); }
.svc-price-cost { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.svc-row-actions { display: flex; align-items: center; gap: 6px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 22px; transition: background 0.2s; }
.switch .slider::before {
  position: absolute; content: '';
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* Manual sync multi-select items */
.ms-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  align-items: flex-start;
}
.ms-item:hover { background: var(--bg-soft); }
.ms-item input[type=checkbox] { margin-top: 3px; flex-shrink: 0; }
.ms-item-body { flex: 1; min-width: 0; }
.ms-item-body > div:first-child { font-size: 13px; line-height: 1.4; word-break: break-word; }

@media (max-width: 640px) {
  .svc-row { grid-template-columns: 1fr; }
  .svc-row-price { text-align: left; }
  .svc-row-actions { justify-content: flex-end; }
}

/* ===== Utility ===== */
.hide-mobile { display: block; }
.show-mobile { display: none; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ===== Tablet ===== */
@media (max-width: 1024px) {
  .main { padding: 24px 22px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  html, body { font-size: 14px; }

  .menu-toggle { display: flex; }

  .nav {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: none;
  }
  .nav.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.35); }

  .main { margin-left: 0; padding: 66px 14px 24px; }
  .topbar { flex-wrap: wrap; margin-bottom: 18px; }
  .topbar h2 { font-size: 20px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .feature-grid, .steps, .pricing { grid-template-columns: 1fr; }

  .card { padding: 16px; border-radius: 10px; }
  .card h3 { font-size: 15px; }
  .card table { margin: -16px; width: calc(100% + 32px); }
  .card table th:first-child, .card table td:first-child { padding-left: 16px; }
  .card table th:last-child, .card table td:last-child { padding-right: 16px; }

  /* Scrollable tables */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card > table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card > table thead, .card > table tbody, .card > table tr { width: 100%; }

  th, td { padding: 10px 10px; font-size: 13px; }
  th { font-size: 10px; }

  .stat { padding: 14px; gap: 10px; }
  .stat .stat-icon { width: 38px; height: 38px; font-size: 18px; }
  .stat .stat-body .value { font-size: 21px; }
  .stat .stat-body .label { font-size: 11px; }

  .section { padding: 48px 16px; }
  .section-head { margin-bottom: 28px; }
  .section-head h2 { font-size: 26px; }
  .section-head p { font-size: 14px; }

  .hero { padding: 60px 18px 40px; }
  .hero h1 { font-size: 34px; }
  .hero .sub { font-size: 15px; }
  .hero .ctas { flex-direction: column; align-items: stretch; width: 100%; max-width: 340px; margin: 0 auto 28px; }
  .hero .ctas .btn { justify-content: center; }
  .chat-mock { max-width: 100%; }

  .mk-header .inner { padding: 12px 14px; gap: 8px; }
  .mk-logo { font-size: 15px; }
  .mk-nav-links { display: none; }
  .mk-menu-btn { display: inline-flex; }

  .store-wrap { padding: 20px 14px 60px; }
  .store-head h1 { font-size: 24px; }
  .platform-card { padding: 14px; }
  .platform-card .emoji { font-size: 26px; }
  .platform-card .name { font-size: 14px; }
  #platforms.grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .auth-card { padding: 26px 20px; border-radius: 14px; }
  .auth-card h1 { font-size: 20px; }

  .modal { padding: 20px; border-radius: 14px; }
  .btn.lg { padding: 12px 22px; font-size: 15px; }

  .mk-footer { padding: 40px 18px 24px; }
  .mk-footer .inner { grid-template-columns: 1fr 1fr; gap: 24px; }

  .price { padding: 22px; }
  .price .amount { font-size: 32px; }
  .feature { padding: 20px; }
  .step { padding: 22px 20px; }

  .hide-mobile { display: none; }
  .show-mobile { display: block; }
}

/* ===== Small phone ===== */
@media (max-width: 480px) {
  .hero h1 { font-size: 28px; }
  .hero .sub { font-size: 14px; }
  .chat-mock { padding: 14px; }
  .chat-mock .bubble { font-size: 13px; padding: 8px 12px; }
  .section-head h2 { font-size: 22px; }
  .stat .stat-body .value { font-size: 19px; }
  .stat { padding: 12px; }
  #platforms.grid-4 { grid-template-columns: 1fr; }
  .mk-footer .inner { grid-template-columns: 1fr; }
  .mk-header .btn.sm { padding: 6px 10px; font-size: 11px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
