:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #273549;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: #d97706;
  --warning-text: #fde68a;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
}

.brand p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.topbar-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upsell-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #93c5fd;
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.81rem;
  font-weight: 600;
}

.upsell-pill:hover {
  background: rgba(59, 130, 246, 0.28);
}

.upsell-pill-secondary {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.upsell-pill-secondary:hover {
  background: rgba(16, 185, 129, 0.25);
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px;
}

.disclaimer-banner {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.preset-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}

.preset-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1040px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .row-2 {
    grid-template-columns: 1fr !important;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

label.field {
  display: grid;
  gap: 5px;
  font-size: 0.81rem;
  color: var(--muted);
}

label.field code {
  color: #93c5fd;
  font-size: 0.76rem;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.86rem;
  font-family: inherit;
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.79rem;
  line-height: 1.45;
}

.bot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 540px) {
  .bot-grid {
    grid-template-columns: 1fr;
  }
}

.bot-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bot-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bot-name {
  font-weight: 700;
  font-size: 0.83rem;
  color: #f8fafc;
}

.bot-tag {
  font-size: 0.69rem;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  font-weight: 700;
}

.bot-tag.search {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}

.bot-tag.training {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.bot-desc {
  font-size: 0.73rem;
  color: var(--muted);
}

.bot-select {
  margin-top: 4px;
  padding: 5px 8px;
  font-size: 0.79rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.main-col {
  display: grid;
  gap: 18px;
}

.geo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.geo-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.score-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.score-num {
  font-size: 1.65rem;
  font-weight: 800;
  color: #6ee7b7;
}

.score-max {
  font-size: 0.85rem;
  color: var(--muted);
}

.progress-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  transition: width 0.2s ease;
}

.geo-grade-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.status-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.bot-summary {
  font-size: 0.79rem;
  color: var(--muted);
  font-weight: 600;
}

.geo-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 720px) {
  .geo-checklist {
    grid-template-columns: 1fr;
  }
}

.geo-check-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.79rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.geo-check-item.passed {
  border-color: rgba(16, 185, 129, 0.35);
}

.geo-check-item.warn {
  border-color: rgba(245, 158, 11, 0.45);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn:hover {
  border-color: #475569;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

pre.code-output {
  margin: 0;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: #e2e8f0;
  overflow-x: auto;
  max-height: 440px;
  white-space: pre-wrap;
  word-break: break-word;
}

.rendered-preview {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  max-height: 440px;
  overflow-y: auto;
}

.rendered-preview h3 {
  margin-top: 0;
  color: #fff;
}

.rendered-preview blockquote {
  margin: 8px 0 14px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: rgba(59, 130, 246, 0.1);
  color: #bfdbfe;
}

.rendered-preview ul {
  padding-left: 18px;
}

.rendered-preview a {
  color: #60a5fa;
}

.funnel-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border-color: rgba(59, 130, 246, 0.4);
}

.funnel-inner h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #fff;
}

.funnel-inner p {
  margin: 0 0 12px;
  font-size: 0.84rem;
  color: var(--muted);
}

.funnel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.footer a {
  color: #93c5fd;
}
