.dashboard-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  overflow: hidden;
}

.dashboard-hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 460px);
  align-items: center;
  gap: 40px;
  padding: 42px 0;
}

.dashboard-loaded .dashboard-hero {
  min-height: auto;
  grid-template-columns: 1fr;
  padding: 30px 0 22px;
}

.dashboard-welcome[hidden],
.dashboard-intro[hidden],
.lookup-card[hidden] {
  display: none;
}

.dashboard-welcome {
  max-width: 820px;
}

.dashboard-welcome h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 58px);
}

.dashboard-hero h1 {
  max-width: 720px;
  font-size: clamp(46px, 6vw, 72px);
  line-height: 1;
}

.dashboard-hero .lede {
  max-width: 620px;
}

.lookup-card,
.partner-hero-card,
.dashboard-metrics article,
.progress-card,
.payout-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 58px rgba(14, 17, 24, 0.08);
}

.lookup-card {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.lookup-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
}

.lookup-card input {
  min-height: 48px;
}

.lookup-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-content {
  display: grid;
  gap: 18px;
  padding-bottom: 80px;
}

.dashboard-content[hidden] {
  display: none;
}

.partner-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr);
  gap: 22px;
  align-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 92% 16%, rgba(21, 93, 252, 0.14), transparent 34%),
    linear-gradient(135deg, #ffffff, #f8fbff);
}

.partner-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #0e1118);
  box-shadow: 0 18px 38px rgba(21, 93, 252, 0.22);
  font-size: 28px;
  font-weight: 950;
}

.partner-identity span:not(.avatar),
.dashboard-metrics span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.partner-identity h2 {
  margin: 8px 0 4px;
  font-size: 34px;
}

.partner-identity p {
  margin-bottom: 0;
  color: var(--muted);
}

.referral-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.referral-box code {
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.link-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-metrics article {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(21, 93, 252, 0.05), rgba(255, 255, 255, 0) 42%),
    #fff;
}

.dashboard-metrics strong {
  display: block;
  margin-top: 10px;
  font-size: 38px;
  line-height: 1;
}

.progress-card,
.payout-card {
  padding: 26px;
}

.card-headline,
.payout-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.card-headline strong {
  font-size: 28px;
}

.card-headline p:not(.eyebrow) {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.mission-score {
  min-width: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.mission-score span {
  display: block;
  color: var(--blue);
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
}

.mission-score strong {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.goal-track {
  position: relative;
  padding: 36px 0 30px;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.progress-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.35s ease;
}

.goal-marker {
  position: absolute;
  top: 9px;
  display: grid;
  place-items: center;
  width: 58px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(14, 17, 24, 0.08);
  transform: translateX(-50%);
}

.goal-marker b {
  font-size: 18px;
  line-height: 1;
}

.goal-marker span {
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
}

.goal-marker.complete {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.goal-marker.complete span {
  color: #d1fae5;
}

.marker-ten {
  left: 50%;
}

.marker-twenty {
  left: 100%;
}

.milestone-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 850;
}

.milestone-row span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.milestone-row span.complete {
  color: #0b6b51;
  border-color: rgba(12, 139, 103, 0.32);
  background: #ecfdf5;
}

.milestone-row b {
  color: var(--ink);
}

.milestone-row strong {
  color: var(--green);
}

.payout-card form {
  min-width: 320px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.payout-card p {
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 920px) {
  .dashboard-hero,
  .partner-hero-card,
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    min-height: auto;
    padding-top: 28px;
  }

  .dashboard-hero h1 {
    font-size: clamp(42px, 10vw, 62px);
  }

  .payout-card,
  .card-headline {
    align-items: stretch;
    flex-direction: column;
  }

  .payout-card form {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .dashboard-page {
    width: min(100% - 28px, 1180px);
  }

  .dashboard-hero {
    min-height: auto;
    gap: 22px;
    padding: 24px 0 34px;
  }

  .dashboard-hero h1 {
    font-size: 40px;
  }

  .lookup-card {
    padding: 18px;
  }

  .milestone-row {
    flex-direction: column;
  }

  .partner-hero-card,
  .progress-card,
  .payout-card {
    padding: 18px;
  }

  .partner-identity {
    align-items: flex-start;
  }

  .avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 22px;
  }

  .link-copy-row {
    grid-template-columns: 1fr;
  }
}
