:root {
  --bg: #000000;
  --bg-alt: #0a0a0a;
  --panel: #0f0f0f;
  --text: #f5f7ff;
  --muted: #e2edff;
  --accent: #5ec8ff;
  --accent-weak: rgba(94, 200, 255, 0.16);
  --border: #12385a;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
  --radius-card: 8px;
  --radius-btn: 6px;
  --radius-input: 4px;
  --transition: 200ms ease;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

#creditsBar { position: fixed; right: 18px; top: 12px; z-index: 2000; background: rgba(94,200,255,0.08); color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
#creditsBar #creditsValue { font-weight: 700; }

/* Plans overlay for trial gate */
#trialOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; z-index: 3000; }
#trialOverlay .box { background: rgba(10,10,10,0.95); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 28px; width: 640px; text-align: center; box-shadow: var(--shadow); }
.banner-title { font-weight: 800; font-size: 22px; margin-bottom: 8px; }
.banner-sub { font-size: 16px; opacity: 0.9; margin-bottom: 16px; }
.btn-primary { background: var(--accent); color: var(--text); border: 1.5px solid var(--accent); box-shadow: 0 0 20px rgba(94,200,255,0.15); }

#app { display: grid; grid-template-columns: 240px 1fr; height: 100vh; background: var(--bg); }

.sidebar { border-right: 1px solid var(--border); padding: 24px 16px; background: var(--bg-alt); backdrop-filter: blur(12px); }
.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 24px;
  font-size: 22px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 10px; }
.tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.tab:hover { background: var(--bg-alt); border-color: var(--accent); transform: translateY(-1px); }
.tab.active { background: rgba(94,200,255,0.12); color: var(--text); border-color: var(--accent); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }

.content { padding: 32px 40px; overflow: auto; max-width: 1600px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.content h1 { margin: 0 0 16px 0; font-weight: 700; letter-spacing: -0.02em; font-size: 32px; }
.title-center { text-align: center; }
.content h2 { margin: 0 0 10px 0; font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.step h2 { margin-bottom: 6px; }
.step .muted { margin-top: 2px; }

.card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow); transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.card:hover { border-color: var(--accent); box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 18px rgba(94,200,255,0.08); }
.step { display: flex; flex-direction: column; gap: 8px; }

input[type="file"], select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input[type="number"], input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

button {
  appearance: none;
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: var(--radius-btn);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition), color var(--transition);
}
button:hover { background: #75d1ff; box-shadow: 0 0 20px rgba(94,200,255,0.18); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: rgba(94,200,255,0.08); color: var(--text); }
.btn-outline.small-btn { min-width: 0; width: auto; font-size: 13px; padding: 6px 16px; align-self: flex-start; }
.big { font-size: 16px; padding: 12px 20px; }

.muted { color: var(--muted); }
.muted.small { font-size: 12px; }

.crunchbase-layout { display: flex; flex-wrap: nowrap; gap: 32px; align-items: flex-start; justify-content: center; padding: 0 24px; }
.crunchbase-instructions { flex: 1 1 640px; max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.crunchbase-instructions .card { margin: 0; }
.crunchbase-video { flex: 0 0 520px; max-width: 520px; display: flex; align-items: stretch; justify-content: flex-end; }
.crunchbase-video-embed { border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 18px 45px rgba(0,0,0,0.45); width: 100%; }

.phone-layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.phone-instructions { flex: 1 1 520px; display: flex; flex-direction: column; gap: 16px; }
.phone-video { flex: 1 1 360px; max-width: 520px; display: flex; align-items: flex-start; justify-content: center; }
.phone-video-embed { width: 100%; border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow); }
.video-placeholder { width: 100%; aspect-ratio: 16/9; border: 1.5px dashed var(--border); border-radius: var(--radius-card); display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.03); color: var(--muted); font-weight: 500; font-size: 14px; }
.pf-cookie-actions { margin-top: 12px; }
.pf-upload-btn { width: auto; align-self: flex-start; padding: 8px 18px; }

@media (max-width: 1024px) {
  .crunchbase-layout { flex-direction: column; gap: 24px; padding: 0 18px; }
  .crunchbase-instructions, .crunchbase-video { max-width: 100%; flex: 1 1 auto; }
  .crunchbase-video { justify-content: center; }
  .apollo-layout { flex-direction: column; gap: 24px; padding: 0 18px; }
  .apollo-instructions { max-width: 100%; }
  .apollo-aside { max-width: 100%; width: 100%; }
  .apollo-paygo { max-width: 100%; }
  .aleads-layout { flex-direction: column; gap: 24px; padding: 0 18px; }
  .aleads-instructions, .aleads-video { max-width: 100%; flex: 1 1 auto; }
  .aleads-video { justify-content: center; }
  .tutorial-layout { flex-direction: column; gap: 18px; padding: 0 12px; }
  .tutorial-video, .tutorial-instructions { max-width: 100%; flex: 1 1 auto; justify-content: center; }
  .phone-layout { flex-direction: column; }
  .phone-video { width: 100%; max-width: none; }
}

.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255,255,255,0.04);
  transition: background 120ms ease, border-color 120ms ease;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { background: var(--accent-weak); color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: 999px; display: inline-flex; gap: 8px; align-items: center; }
.tag { transition: transform 120ms ease, background 120ms ease; }
.tag:active { transform: scale(0.98); }
.tag .x {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}
.tags-input textarea {
  flex: 1;
  min-width: 240px;
  min-height: 28px;
  resize: none;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  transition: color 120ms ease;
}

.progress { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); overflow: hidden; }
.bar { height: 100%; background: var(--accent); width: 0%; transition: width 0.25s ease; }
.progress-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.log { margin-top: 8px; font-size: 12px; color: var(--muted); max-height: 120px; overflow: auto; }

.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.actions.center { justify-content: center; }
.table-wrap { overflow: auto; max-height: 50vh; border: 1px solid var(--border); border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: auto; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-weight: 600; opacity: 1; }
thead th { position: sticky; top: 0; background: rgba(94,200,255,0.08); }

/* extra spacing between download button and table */
#resultsCard .actions { margin-bottom: 12px; }
#efResultsCard .actions { margin-bottom: 12px; }
#cdfResultsCard .actions { margin-bottom: 12px; }
#wsResultsCard .actions { margin-bottom: 12px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.map-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.map-row label { width: 160px; color: var(--muted); }

.toggle { display: inline-flex; justify-content: center; gap: 10px; width: auto; }
.toggle { position: relative; z-index: 1000 !important; }
.center .toggle { margin: 0 auto; }
.center .switch { margin: 6px auto 0; }
.seg { position: relative; z-index: 1001; background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--border); padding: 10px 16px; border-radius: 999px; cursor: pointer; }
.seg { pointer-events: auto; }
.seg.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.seg-input { position: absolute; left: -9999px; visibility: hidden; }
.seg-input:checked + label.seg { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.switch input { width: 18px; height: 18px; }

/* Pricing / Plans */
.trial-banner { text-align:center; padding: 18px 22px; }
.trial-banner .trial-head { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.trial-banner .trial-sub { font-size: 16px; opacity: 0.9; }
.pricing-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; align-items: stretch; }
.plan-card { position: relative; padding-top: 28px; width: 100%; }
.plan-card .badge { position:absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color:#000; font-weight:800; font-size:12px; padding:4px 10px; border-radius:999px; border:1px solid var(--border); box-shadow: var(--shadow); }
.plan-card.popular { border-color: var(--accent); box-shadow: 0 10px 30px rgba(94,200,255,0.25); }

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px rgba(255,255,255,0.04) inset;
  -webkit-text-fill-color: #f5f7ff;
  caret-color: #f5f7ff;
}

.tutorial-layout { display: flex; flex-wrap: nowrap; gap: 32px; align-items: flex-start; justify-content: center; padding: 0 12px; }
.tutorial-instructions { flex: 1 1 640px; max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.tutorial-video { flex: 0 0 520px; max-width: 520px; display: flex; align-items: stretch; justify-content: flex-end; }
.tutorial-video-embed { border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 18px 45px rgba(0,0,0,0.45); width: 100%; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 4000; }

/* Technology Lists */
.tech-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.tech-card { display:flex; flex-direction: column; align-items: center; justify-content: space-evenly; padding: 24px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); aspect-ratio: 1 / 1; text-align: center; gap: 10px; }
.tech-card-head { display:flex; flex-direction: column; gap: 10px; align-items: center; }
.tech-logo { width: 76px; height: 76px; border-radius: 18px; background: rgba(255,255,255,0.04) center/contain no-repeat; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--text); letter-spacing: -0.01em; font-size: 22px; }
.tech-name { font-size: 20px; font-weight: 800; }
.tech-stats { color: var(--muted); font-size: 14px; }
.tech-actions { display:flex; justify-content: center; width: 100%; }
.tech-download { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; background: var(--accent); color: var(--text); border: 1.5px solid var(--accent); border-radius: var(--radius-btn); font-weight: 700; min-width: 140px; box-shadow: 0 0 20px rgba(94,200,255,0.14); }
.tech-download:hover { background: #75d1ff; color: var(--bg); }

@media (max-width: 1080px){
  .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px){
  .tech-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}
.modal-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 22px; width: min(480px, 90vw); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.modal-card .modal-title,
.modal-card .modal-body { text-align: center; }
.api-key-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.api-key-value { background: rgba(255,255,255,0.04); padding: 8px 12px; border-radius: 6px; border: 1px dashed var(--border); }
.api-key-actions { display: flex; gap: 8px; }
.api-doc { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px; white-space: pre-wrap; overflow-x: auto; }
.api-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.api-card { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 22px; background: rgba(255,255,255,0.03); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.api-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.api-card-title { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.api-card-sub { font-size: 12px; color: var(--muted); }
.api-card-body { display: flex; flex-direction: column; gap: 10px; }
.api-stack { display: flex; flex-direction: column; gap: 18px; }
.api-card.tall { width: 100%; }
.api-line { font-size: 14px; line-height: 1.6; }
.url-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icon-btn { border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text); border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,0.08); }
.code-block { position: relative; background: rgba(0,0,0,0.35); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px; font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; }
.code-block .icon-btn { position: absolute; top: 10px; right: 10px; }
.curl-modal form { display: flex; flex-direction: column; gap: 10px; }
.curl-field { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
.curl-field label { font-weight: 600; font-size: 13px; }
.curl-field input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-input); padding: 8px 10px; background: rgba(255,255,255,0.03); color: var(--text); }
.modal-title { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.modal-body { color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal-card .actions { justify-content: center !important; }
.plan-name { font-weight: 900; font-size: 19px; text-align:center; }
.plan-price { font-weight: 900; font-size: 30px; margin-top: 6px; text-align:center; }
.plan-price .per { font-size: 14px; font-weight: 600; opacity: 0.85; margin-left: 2px; }
.plan-meta { margin-top: 8px; text-align:center; color: var(--muted); font-size: 13px; }
.feature-list { list-style:none; padding:0; margin:16px 0 0 0; border-top:1px solid var(--border); }
.feature-list li { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); font-size: 14px; }
.feature-list .tick { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background: var(--accent-weak); color: var(--accent); font-weight:800; }
.download-bar { margin-top: 12px; justify-content: flex-end; }

/* Center the 4th plan in the second row on wide screens */
@media (min-width: 1200px) {
  .pricing-grid { grid-template-columns: repeat(3, minmax(420px, 1fr)); justify-content: center; }
  .pricing-grid .plan-card:nth-child(4) { grid-column: 2; }
}

/* Apollo Scraper layout */
.apollo-layout { display: flex; flex-wrap: nowrap; gap: 24px; align-items: flex-start; justify-content: space-between; padding: 0 12px; }
.apollo-instructions { flex: 1 1 580px; max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.apollo-instructions .card { margin: 0; }
.apollo-aside { display: flex; flex-direction: column; gap: 14px; flex: 0 0 500px; max-width: 520px; width: 100%; align-self: flex-start; }
.apollo-paygo { flex: 0 0 500px; max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 24px; align-self: flex-start; }
.apollo-paygo .big { width: 100%; }
.apollo-paygo .price { color: var(--text); font-weight: 700; }
.apollo-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent-weak); color: var(--text); border: 1px solid var(--border); font-weight: 700; font-size: 12px; width: fit-content; }
.apollo-aside .tutorial-video-embed { width: 100%; min-height: 220px; }
