:root {
  --bg: #fff5fb;
  --surface: #ffffff;
  --text: #2f1230;
  --muted: #7d5a7f;
  --primary: #e6778e;
  --primary-dark: #cc5b73;
  --primary-soft: #ffe0f2;
  --border: #f3cde5;
  --shadow: 0 16px 36px rgba(123, 35, 89, 0.14);
  --radius-xl: 1rem;
  --radius-lg: 0.85rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, #ffdff1 0, transparent 38%),
    radial-gradient(circle at 100% 12%, #ffeaf7 0, transparent 28%),
    var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(255, 247, 252, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 247, 252, 0.92);
  border-bottom: 1px solid var(--border);
  pointer-events: none;
  z-index: -1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 0;
}

.brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 1.05rem;
  margin-left: auto;
}

.nav-links a {
  text-decoration: none;
  color: #8a4d76;
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--primary-dark);
}

.menu-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.22rem;
}

.menu-toggle span {
  width: 0.95rem;
  height: 2px;
  background: #7a355f;
  border-radius: 2px;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0.8rem;
  border: 1px solid transparent;
  padding: 0.68rem 1rem;
  transition: 0.2s ease;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-outline {
  color: var(--text);
  border-color: var(--border);
  background: #fff;
}

.btn-outline:hover {
  border-color: #e8abd0;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, #f2a0b0 100%);
  box-shadow: 0 10px 20px rgba(177, 36, 101, 0.18);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
}

.btn-primary:active {
  transform: translateY(0);
}

.hero {
  padding: 5rem 0 2.6rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 1.2rem;
  align-items: start;
}

h1,
h2,
h3 {
  margin: 0 0 0.6rem;
  line-height: 1.18;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--primary-dark);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  font-weight: 700;
}

.lead,
.section-lead {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.trust-row {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.trust-row span {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.34rem 0.65rem;
  font-size: 0.8rem;
  color: #8b5b84;
}

#status-pill.is-loading {
  border-color: #f1b6d8;
  background: #fff7fc;
}

#status-pill.is-error {
  border-color: #f1b6d8;
  background: #fff1f1;
  color: #9d2031;
}

.hero-panel,
.card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  background: linear-gradient(160deg, #ad2f74 0%, #d93f93 48%, #f06cb1 100%);
  color: #fff;
  padding: 1.25rem;
}

.hero-panel h3,
.hero-panel p {
  color: #fff;
}

.panel-kicker {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.74rem;
  color: #ffd9ec;
  font-weight: 700;
}

.panel-metrics {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.panel-metrics div {
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 208, 234, 0.5);
  background: rgba(255, 255, 255, 0.14);
  padding: 0.55rem;
}

.panel-metrics strong {
  display: block;
}

.panel-metrics span {
  font-size: 0.78rem;
  color: #ffeaf6;
}

.section {
  padding: 2.2rem 0 3.1rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.alt {
  background: linear-gradient(180deg, #fff0f9 0%, #fff8fc 100%);
}

.stats-grid,
.steps,
.two-col {
  margin-top: 1.05rem;
  display: grid;
  gap: 1rem;
}

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

.kpi-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-card.subtle {
  box-shadow: none;
  background: linear-gradient(180deg, #fffafb 0%, #ffffff 100%);
}

.two-col {
  grid-template-columns: 1.25fr 0.95fr;
  align-items: start;
}

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

.card {
  padding: 1rem;
}

.controls {
  padding: 0.85rem;
  display: grid;
  grid-template-columns: 1.1fr 1.1fr auto;
  gap: 0.75rem;
  align-items: end;
  min-width: min(520px, 92vw);
}

.control label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: #8f6287;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

select,
.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.62rem 0.7rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: #fff;
}

select:focus,
.input:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(229, 72, 155, 0.16);
  border-color: #e8abd0;
}

.control-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  background: #fff;
  color: #8b5b84;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.vendor-controls {
  padding: 0.85rem;
  display: grid;
  gap: 0.65rem;
  min-width: min(520px, 92vw);
}

.tier-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  border: 1px solid var(--border);
  background: #fff;
  color: #7a355f;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.15s ease;
}

.chip:hover {
  border-color: rgba(230, 119, 142, 0.55);
}

.chip.is-active {
  background: rgba(230, 119, 142, 0.14);
  border-color: rgba(230, 119, 142, 0.55);
  color: #5a1b42;
}

.vendor-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
  align-items: start;
}

.vendor-side {
  display: grid;
  gap: 1rem;
}

.vendor-score-row {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

tr.is-clickable {
  cursor: pointer;
}

tr.is-clickable:hover td {
  background: rgba(230, 119, 142, 0.06);
}

td {
  background: transparent;
}

.kpi-label {
  margin: 0;
  color: #8f6287;
  font-size: 0.85rem;
  font-weight: 600;
}

.stat-value {
  margin: 0.18rem 0 0.25rem;
  color: #731f54;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-delta {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.positive {
  color: #0f7c4b;
}

.negative {
  color: #b83d32;
}

.accent {
  background: linear-gradient(180deg, #fff6fc 0%, #ffe8f6 100%);
}

.table-help {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.tools-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cell-title {
  font-weight: 700;
  color: #5a1b42;
}

.cell-sub {
  margin-top: 0.12rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  text-align: left;
  padding: 0.65rem;
  border-bottom: 1px solid #f5d8e9;
  font-size: 0.9rem;
}

th {
  color: #8f5d83;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.opportunity-list {
  margin: 0.75rem 0 0;
  padding-left: 1rem;
}

.opportunity-list li {
  margin-bottom: 0.45rem;
  color: #734563;
}

.opportunity-list li strong {
  color: #5a1b42;
}

.mini-bars {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.7rem;
}

.mini-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #6a2a53;
  font-weight: 700;
}

.mini-bar-track {
  margin-top: 0.35rem;
  height: 10px;
  border-radius: 999px;
  background: rgba(229, 72, 155, 0.12);
  border: 1px solid rgba(243, 205, 229, 0.9);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c92a7f 0%, #e5489b 55%, #f06cb1 100%);
}

.risk-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.58rem;
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.risk-high {
  color: #ffffff;
  background: #be4e47;
}

.risk-mid {
  color: #ffffff;
  background: #b58519;
}

.risk-low {
  color: #ffffff;
  background: #1d8a57;
}

.funnel-step {
  position: relative;
  overflow: hidden;
}

.funnel-step::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -35px;
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 225, 0.5) 0%, transparent 72%);
}

.score-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.58rem;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.score-high {
  background: #1d8a57;
}

.score-mid {
  background: #b58519;
}

.score-low {
  background: #be4e47;
}

.site-footer {
  padding: 1rem 0 2.2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 960px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .controls {
    min-width: 0;
    grid-template-columns: 1fr 1fr;
  }

  .control-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .vendor-grid {
    grid-template-columns: 1fr;
  }

  .vendor-controls {
    min-width: 0;
  }
}

@media (max-width: 840px) {
  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav .btn-outline {
    display: none;
  }

  .nav-links {
    display: none;
    width: 100%;
    margin: 0.6rem 0 0;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: #fff;
    padding: 0.55rem;
    flex-direction: column;
    gap: 0.2rem;
    order: 3;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.5rem;
    border-radius: 0.55rem;
  }

  .hero-grid,
  .two-col,
  .kpi-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 520px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .control-actions {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 4rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  table {
    min-width: 460px;
  }
}
