:root {
  --bg: #09090b;
  --panel: #18181b;
  --panel-2: #111114;
  --panel-3: #0b0b0d;
  --line: #27272a;
  --line-2: #3f3f46;
  --text: #f4f4f5;
  --text-soft: #d4d4d8;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --brand: #fafafa;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.1), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.05), transparent 22%),
    var(--bg);
  font-family: "Inter", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-body {
  height: 100vh;
  overflow: hidden;
}

.workspace-shell {
  display: flex;
  height: 100vh;
  background: var(--bg);
}

.workspace-sidebar {
  width: 264px;
  border-right: 1px solid var(--line);
  background: rgba(24, 24, 27, 0.98);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.workspace-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-topbar,
.public-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.workspace-topbar {
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(24, 24, 27, 0.66);
  padding: 18px 24px;
}

.workspace-content {
  flex: 1;
  overflow: auto;
  padding: 24px;
}

.workspace-content > * {
  max-width: 1180px;
  margin: 0 auto;
}

.workspace-content > * + * {
  margin-top: 24px;
}

.public-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.public-topbar {
  padding: 6px 0 28px;
}

.public-content > * + * {
  margin-top: 24px;
}

.brand,
.status-row,
.buttons,
.toolbar,
.tabs,
.public-actions,
.topbar-actions,
.hero-actions,
.row-between,
.lead-top,
.block-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.brand {
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #fafafa, #a1a1aa);
  color: #09090b;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-copy,
.page-intro,
.sidebar-block,
.sidebar-footer,
.sidebar-metric {
  display: grid;
  gap: 6px;
}

.brand-subtitle,
.page-subtitle,
.hero-sub,
.lead-summary,
.muted {
  color: var(--muted);
}

.section-label,
.eyebrow,
th {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.page-title {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2rem);
  font-weight: 600;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-link,
.ghost-btn,
.btn-link {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(24, 24, 27, 0.96);
  color: var(--text-soft);
  text-decoration: none;
  transition: 140ms ease;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(24, 24, 27, 0.96);
  color: var(--text-soft);
  text-decoration: none;
}

.nav-link:hover,
.ghost-btn:hover {
  background: #27272a;
  color: var(--text);
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.nav-link.active,
.tab.active {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
  color: #dbeafe;
}

.nav-count,
.tab span,
.mono,
code,
pre,
.badge {
  font-family: "IBM Plex Mono", monospace;
}

.nav-count,
.tab span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #0f172a;
  color: #bfdbfe;
  font-size: 0.75rem;
}

.card,
.hero,
.stat-card,
.detail-head,
.detail-block,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.98), rgba(17, 17, 20, 0.98));
  box-shadow: var(--shadow);
  padding: 24px;
}

.hero,
.hero-grid,
.detail-grid,
.form-grid,
.stat-grid,
.pricing-grid,
.marketing-grid {
  display: grid;
  gap: 16px;
}

.hero {
  gap: 20px;
}

.hero-grid,
.marketing-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
}

.detail-grid,
.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-grid,
.pricing-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.landing-hero-grid {
  align-items: stretch;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.95fr);
}

.landing-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.landing-stat-grid .stat-card {
  min-height: 100%;
}

.panel-grid {
  display: grid;
  gap: 16px;
}

.stat-card {
  background: var(--panel-3);
  padding: 18px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.stat-value {
  margin-top: 10px;
  display: block;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.15;
}

.summary-strip,
pre {
  border: 1px solid var(--line);
  background: var(--panel-3);
  border-radius: 16px;
}

.summary-strip {
  padding: 16px;
}

.lead-list {
  display: grid;
  gap: 14px;
}

.lead-card {
  display: grid;
  gap: 14px;
}

.lead-title,
.detail-title {
  margin: 0;
}

.lead-title a {
  text-decoration: none;
}

.lead-title a:hover {
  text-decoration: underline;
}

.table-wrap,
.notice {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-3);
}

.table-wrap {
  overflow: hidden;
}

.notice {
  padding: 16px;
}

.badge,
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 500;
}

.badge {
  background: rgba(39, 39, 42, 0.92);
  color: var(--text-soft);
}

.badge-info,
.intent-high,
.intent-buying_now {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.24);
  color: #93c5fd;
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.24);
  color: #6ee7b7;
}

.badge-warning,
.intent-medium,
.intent-researching {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.24);
  color: #fcd34d;
}

.badge-danger,
.intent-low,
.intent-not_a_lead {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.24);
  color: #fca5a5;
}

.btn,
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  border: 1px solid transparent;
  background: var(--brand);
  color: #09090b;
  cursor: pointer;
  min-height: 42px;
  transition:
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.btn.secondary {
  background: #27272a;
  border-color: #3f3f46;
  color: var(--text);
}

.btn:hover,
.btn-link:hover {
  background: #e4e4e7;
  color: #09090b;
  transform: translateY(-1px);
}

.btn.secondary:hover {
  background: #323238;
  color: var(--text);
}

.ghost-btn-button {
  appearance: none;
  cursor: pointer;
}

.ghost-btn,
.btn-link,
.btn {
  min-height: 42px;
}

.btn:active,
.btn-link:active,
.ghost-btn:active,
.nav-link:active,
.tab:active {
  transform: translateY(0);
}

.btn:disabled,
.btn-link[aria-disabled="true"],
.ghost-btn[aria-disabled="true"],
.ghost-btn-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn:focus-visible,
.btn-link:focus-visible,
.ghost-btn:focus-visible,
.nav-link:focus-visible,
.tab:focus-visible {
  outline: none;
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.status-form,
.inline-form,
label {
  display: grid;
  gap: 8px;
}

.status-form,
.inline-form {
  grid-template-columns: repeat(auto-fit, minmax(160px, auto));
  align-items: end;
}

label {
  font-size: 0.92rem;
  color: var(--text-soft);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.checkbox-row-compact {
  gap: 10px;
}

.checkbox-copy {
  display: grid;
  gap: 4px;
}

.checkbox-title {
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.checkbox-row .hero-sub {
  margin: 0;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-3);
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  min-height: 124px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #60a5fa;
  flex: 0 0 auto;
  margin-top: 2px;
}

.btn-compact,
.btn-link.btn-compact,
.ghost-btn.btn-compact {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.lead-actions {
  gap: 8px;
}

.status-form-compact {
  grid-template-columns: minmax(148px, 180px) auto;
  justify-content: start;
  gap: 10px;
}

.status-form-compact label {
  gap: 6px;
}

.status-form-compact .btn {
  align-self: end;
}

.status-form-compact select {
  padding: 9px 12px;
}

.demo-toggle-form {
  margin-right: auto;
}

.filter-row {
  grid-template-columns: minmax(220px, 320px) auto;
  justify-content: start;
  gap: 12px;
}

pre {
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.6;
}

ul,
ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead {
  background: var(--panel-3);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

tbody tr {
  border-bottom: 1px solid var(--line);
}

tbody tr:hover {
  background: rgba(39, 39, 42, 0.4);
}

th,
td {
  padding: 12px 14px;
  vertical-align: top;
  text-align: left;
}

details summary {
  cursor: pointer;
  color: var(--text-soft);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(9, 9, 11, 0.94);
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .workspace-shell,
  .hero-grid,
  .marketing-grid,
  .detail-grid,
  .form-grid,
  .stat-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .workspace-shell {
    display: block;
    height: auto;
  }

  .workspace-sidebar {
    width: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .app-body {
    height: auto;
    overflow: auto;
  }
}

@media (max-width: 640px) {
  .public-shell,
  .workspace-topbar,
  .workspace-content,
  .workspace-sidebar {
    padding: 16px;
  }

  .public-topbar,
  .workspace-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
