:root {
  --bg: #0b0f14;
  --surface: #141b24;
  --border: #243041;
  --text: #e7eef7;
  --muted: #8fa3b8;
  --accent: #10b981;
  --accent-hover: #059669;
  --success: #22c55e;
  --error: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Segoe UI, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 20, 0.9);
  position: sticky;
  top: 0;
}

.logo { font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.inline { display: inline; margin: 0; }

main { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }

.hero { text-align: center; padding: 3rem 0; }
.badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 1rem 0; }
.lead { color: var(--muted); max-width: 640px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); }
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.9rem; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; }

.pricing h2 { text-align: center; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.price { font-size: 2rem; font-weight: 700; margin: 0.5rem 0; }
.price span { font-size: 1rem; color: var(--muted); font-weight: 400; }
.note { text-align: center; color: var(--muted); margin-top: 1.5rem; font-size: 0.9rem; }

.auth-box {
  max-width: 420px;
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

.form { display: flex; flex-direction: column; gap: 1rem; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form select {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.product-form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.hint { font-size: 0.9rem; margin-bottom: 1rem; }
.small { font-size: 0.85rem; }

.muted { color: var(--muted); }
.error { color: var(--error); }
.ok { color: var(--success); }

.dashboard .dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.usage { text-align: right; }
.usage strong { font-size: 1.5rem; display: block; }

.create-box, .jobs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-msg { min-height: 1.25rem; margin-top: 0.5rem; }
.form-msg.ok { color: var(--success); }
.form-msg.err { color: var(--error); }

.job {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}
.job:first-child { border-top: none; padding-top: 0; }
.job-main { display: flex; justify-content: space-between; gap: 1rem; }
.status {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.job-done .status { color: var(--success); }
.job-failed .status { color: var(--error); }
.job-running .status, .job-pending .status { color: var(--accent); }

.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.tab.active { color: var(--text); border-color: var(--accent); }
.tab-panel { display: none; margin-bottom: 1rem; }
.tab-panel.active { display: block; }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }
.profit-table table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 1rem; }
.profit-table th, .profit-table td { border: 1px solid var(--border); padding: 0.4rem 0.5rem; text-align: left; }
.profit-summary { margin-top: 1rem; }
code { background: var(--bg); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.85em; }

.lead.narrow { max-width: 560px; margin: 0 auto 1.5rem; text-align: center; }
.card-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.freq-table-wrap { overflow-x: auto; margin: 1rem 0 2rem; }
.freq-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.freq-table th, .freq-table td { border: 1px solid var(--border); padding: 0.6rem 0.75rem; text-align: left; }
.freq-table td.no { color: var(--error); }
.freq-table td.partial { color: #f59e0b; }
.alerts-box { margin-bottom: 1.5rem; }
.alerts-list { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.alert { border-radius: 8px; padding: 0.65rem 0.85rem; border: 1px solid var(--border); background: var(--bg); }
.alert-error { border-color: var(--error); }
.alert-warn { border-color: #f59e0b; }
.alert-info { border-color: var(--accent); }
.alert p { margin: 0.25rem 0 0; color: var(--muted); }
.schedule-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0.35rem 0;
}
.sched-freq {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.sched-freq input[type="number"] {
  width: 4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none; }
.narrow { max-width: 520px; margin: 0 auto; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; text-align: left; }
.demo-result { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-top: 1rem; }
.roi-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; max-width: 420px; }
.roi-result { margin-top: 0.75rem; font-size: 1.05rem; }
.onboarding-steps { display: flex; gap: 1rem; list-style: none; padding: 0; margin: 0.75rem 0; }
.onboarding-steps li { padding: 0.35rem 0.75rem; border-radius: 999px; border: 1px solid var(--border); font-size: 0.85rem; }
.onboarding-steps li.done { border-color: var(--accent); color: var(--accent); }
.warn-box { background: rgba(234, 179, 8, 0.1); border: 1px solid rgba(234, 179, 8, 0.4); padding: 0.75rem; border-radius: 8px; margin-bottom: 1rem; }
.hint-box { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.35); padding: 0.75rem; border-radius: 8px; margin-bottom: 1rem; }
.stores-list { margin: 0.5rem 0 1rem; }
.store-row { padding: 0.35rem 0; font-size: 0.9rem; }
.connect-form-wrap { margin: 0.5rem 0; }
.trending-list { display: grid; gap: 0.75rem; margin-top: 1rem; }
.trend-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }
.fulfill-list { display: grid; gap: 0.75rem; margin-top: 1rem; }
.fulfill-row { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; }
.track-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; font-size: 0.9rem; }
.track-input { flex: 1; padding: 0.35rem 0.5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.freq-table .ok { color: var(--success); }

/* Help docs */
.help-doc { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem 4rem; line-height: 1.55; }
.help-hero { margin-bottom: 2rem; }
.help-doc h2 { margin-top: 1.75rem; font-size: 1.15rem; }
.help-doc section { margin-bottom: 0.5rem; }
.help-doc ul, .help-doc ol { padding-left: 1.25rem; }

/* Support chat widget */
.lf-support { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; }
.lf-support-toggle {
  border: none; border-radius: 999px; padding: 0.75rem 1.1rem;
  background: var(--accent); color: #04110a; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.lf-support-panel {
  position: absolute; right: 0; bottom: 3.4rem; width: min(380px, calc(100vw - 2rem));
  max-height: min(520px, 70vh); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45); overflow: hidden;
}
.lf-support-panel.hidden,
.lf-support-panel[hidden] { display: none !important; }
.lf-support-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.75rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
  position: relative; z-index: 1; flex-shrink: 0;
}
.lf-support-head-text { flex: 1; min-width: 0; }
.lf-support-close {
  flex-shrink: 0; position: relative; z-index: 2;
  padding: 0.35rem 0.6rem; margin: -0.35rem -0.35rem -0.35rem 0;
}
.lf-support-msgs {
  flex: 1; overflow-y: auto; padding: 0.85rem; display: flex; flex-direction: column; gap: 0.55rem;
  min-height: 220px;
}
.lf-bubble {
  max-width: 92%; padding: 0.55rem 0.75rem; border-radius: 10px;
  font-size: 0.9rem; white-space: pre-wrap; word-break: break-word;
}
.lf-user { align-self: flex-end; background: rgba(52, 211, 153, 0.18); border: 1px solid rgba(52,211,153,0.35); }
.lf-assistant { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); }
.lf-support-form {
  display: flex; gap: 0.4rem; padding: 0.65rem; border-top: 1px solid var(--border);
}
.lf-support-form input {
  flex: 1; padding: 0.5rem 0.65rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
.admin-thread { margin: 0.5rem 0; padding: 0.5rem; border: 1px solid var(--border); border-radius: 8px; }
.admin-msgs { margin-top: 0.5rem; font-size: 0.9rem; }

@media (max-width: 640px) {
  .demo-grid { grid-template-columns: 1fr; }
  .onboarding-steps { flex-direction: column; }
}
