/* Scoped to avoid conflicts with lemma.css .hero / .btn */
.demo-page {
  --demo-ink: #0f172a;
  --demo-muted: #64748b;
  --demo-line: #e2e8f0;
  --demo-brand: #4f46e5;
  --demo-brand-soft: #eef2ff;
  --demo-ok: #166534;
  --demo-ok-bg: #dcfce7;
  --demo-deny: #991b1b;
  --demo-deny-bg: #fee2e2;
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  color: var(--demo-ink);
  text-align: left;
}

.demo-page *,
.demo-page *::before,
.demo-page *::after {
  box-sizing: border-box;
}

.demo-intro {
  margin-bottom: 28px;
}

.demo-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--demo-brand);
  margin: 0 0 8px;
}

.demo-title {
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  color: var(--demo-ink);
  text-align: left;
}

.demo-lead {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--demo-muted);
  max-width: 640px;
}

.demo-workflow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.workflow-step {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  padding-bottom: 28px;
}

.workflow-step:last-child {
  padding-bottom: 0;
}

.workflow-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
}

.workflow-num {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--demo-brand);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.workflow-step.is-done .workflow-num {
  background: #22c55e;
}

.workflow-step.is-active .workflow-num {
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.workflow-line {
  flex: 1;
  width: 2px;
  min-height: 24px;
  margin-top: 8px;
  background: var(--demo-line);
  border-radius: 2px;
}

.workflow-step:last-child .workflow-line {
  display: none;
}

.workflow-body {
  background: #fff;
  border: 1px solid var(--demo-line);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.workflow-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.workflow-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  color: var(--demo-ink);
  text-align: left;
}

.workflow-head h3,
.workflow-body h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 800;
}

.demo-muted {
  margin: 0;
  color: var(--demo-muted);
  font-size: 14px;
  line-height: 1.5;
}

.demo-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #854d0e;
  font-size: 13px;
}

.demo-ready-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--demo-ok-bg);
  border: 1px solid #86efac;
  color: var(--demo-ok);
  font-size: 13px;
}

.demo-ready-banner strong {
  font-size: 14px;
}

.wizard-shell {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--demo-brand-soft);
  border: 1px solid #c7d2fe;
}

.wizard-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.wizard-step-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #4338ca;
}

.wizard-progress {
  display: flex;
  gap: 5px;
}

.wizard-dot {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: #c7d2fe;
  transition: background 0.2s ease;
}

.wizard-dot.active {
  background: var(--demo-brand);
}

.wizard-dot.done {
  background: #22c55e;
}

.status-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-bottom: 14px;
}

.status-card {
  padding: 12px 14px;
  border: 1px solid var(--demo-line);
  border-radius: 12px;
  background: #f8fafc;
}

.status-card-wide {
  min-width: 0;
}

.status-label,
.result-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--demo-muted);
  margin-bottom: 6px;
}

.status-mono,
.result-value,
.ppid-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--demo-ink);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Buttons — demo-prefixed to beat global .btn */
.demo-page .demo-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  white-space: nowrap;
}

.demo-page .demo-btn-primary {
  background: var(--demo-brand);
  color: #fff;
}

.demo-page .demo-btn-secondary {
  background: #fff;
  color: var(--demo-ink);
  border: 1px solid #cbd5e1;
}

.demo-page .demo-btn-danger {
  background: #dc2626;
  color: #fff;
}

.demo-page .demo-btn-quiet {
  margin-top: 6px;
  font-size: 13px;
  padding: 8px 12px;
}

.demo-page .demo-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.demo-pill {
  display: inline-block;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
  background: #f8fafc;
  color: #334155;
}

.demo-pill.ok {
  border-color: #86efac;
  background: var(--demo-ok-bg);
  color: var(--demo-ok);
}

.demo-pill.warn {
  border-color: #facc15;
  background: #fef9c3;
  color: #854d0e;
}

.demo-pill.deny {
  border-color: #fca5a5;
  background: var(--demo-deny-bg);
  color: var(--demo-deny);
}

.site-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.site-card {
  border: 1px solid var(--demo-line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-card.is-human {
  border-color: #86efac;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15);
}

.site-card.is-deny {
  border-color: #fca5a5;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.site-card.is-pending {
  border-color: #fde68a;
}

.site-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.site-card-top h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.result-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--demo-line);
  border-bottom: 1px solid var(--demo-line);
}

.site-card .action-row {
  margin-top: auto;
}

.ppid-compare {
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.ppid-compare-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--demo-ink);
}

.ppid-compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.ppid-slot {
  min-width: 0;
}

.ppid-diff {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--demo-ok);
  padding: 0 4px;
}

.ppid-diff.deny {
  color: var(--demo-deny);
}

.abuse-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 8px;
  align-items: start;
}

.abuse-step {
  padding: 14px;
  border: 1px solid var(--demo-line);
  border-radius: 12px;
  background: #f8fafc;
}

.abuse-arrow {
  align-self: center;
  font-size: 20px;
  font-weight: 900;
  color: #94a3b8;
  padding-top: 28px;
}

.abuse-outcome {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--demo-muted);
  line-height: 1.4;
  min-height: 0;
}

.abuse-outcome.deny {
  color: var(--demo-deny);
  font-weight: 700;
}

.demo-details {
  margin-top: 24px;
  border: 1px solid var(--demo-line);
  border-radius: 14px;
  background: #fff;
  padding: 0 18px;
}

.demo-details summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 800;
  font-size: 15px;
  list-style: none;
}

.demo-details summary::-webkit-details-marker {
  display: none;
}

.demo-details-body {
  padding: 0 0 20px;
  border-top: 1px solid var(--demo-line);
}

.demo-details-body h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.demo-details-body h3:first-child {
  margin-top: 14px;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compare-box {
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
}

.compare-box.bad {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

.compare-box.good {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #14532d;
}

.compare-box h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.compare-box ul {
  margin: 0;
  padding-left: 18px;
}

.compare-box li {
  margin: 4px 0;
}

.code-block {
  background: #0f172a;
  color: #dbeafe;
  border-radius: 10px;
  padding: 12px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  overflow: auto;
  white-space: pre-wrap;
  margin-top: 8px;
}

.demo-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  margin-top: 8px;
}

.demo-log {
  max-height: 160px;
  overflow: auto;
  border: 1px solid var(--demo-line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  font-size: 12px;
  margin-top: 10px;
}

.demo-log div {
  border-bottom: 1px solid var(--demo-line);
  padding: 5px 0;
}

.demo-log div:last-child {
  border-bottom: 0;
}

/* Hide duplicate hero CTA — keep one in workflow head */
#ih-run-guided-demo-hero {
  display: none !important;
}

@media (max-width: 800px) {
  .workflow-step {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
  }

  .workflow-num {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .status-row,
  .site-cards,
  .compare-grid,
  .ppid-compare-grid {
    grid-template-columns: 1fr;
  }

  .abuse-flow {
    grid-template-columns: 1fr;
  }

  .abuse-arrow {
    display: none;
  }

  .workflow-head .demo-btn {
    width: 100%;
  }

  .action-row .demo-btn {
    flex: 1 1 auto;
    min-width: calc(50% - 4px);
  }
}
