:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #596579;
  --paper: #f7f9fb;
  --panel: #ffffff;
  --line: #d8e0e8;
  --blue: #136f9f;
  --green: #1f8a5b;
  --gold: #b77a10;
  --rose: #b44762;
  --shadow: 0 16px 40px rgba(23, 32, 42, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  font-weight: 800;
  text-decoration: none;
  font-size: 1.25rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

nav a {
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

nav a:hover { background: #edf4f8; color: var(--ink); }

main { overflow: hidden; }

.hero,
.dashboard-band,
.content-band,
.split-band,
.feedback-band,
.admin-band {
  padding: clamp(28px, 5vw, 62px) clamp(16px, 4vw, 42px);
}

.hero {
  min-height: 72vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(20px, 5vw, 58px);
  align-items: center;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(13, 34, 48, 0.9), rgba(19, 111, 159, 0.68)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='700' viewBox='0 0 1200 700'%3E%3Crect width='1200' height='700' fill='%23136f9f'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.28' stroke-width='12'%3E%3Cpath d='M95 497c85-108 166-158 244-151 117 11 126 154 241 166 126 14 182-141 320-140 86 1 157 40 213 118'/%3E%3Cpath d='M127 247c66-49 130-69 193-60 94 13 122 103 223 104 104 1 151-92 255-90 74 1 142 33 204 96'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.86'%3E%3Ccircle cx='205' cy='165' r='44'/%3E%3Ccircle cx='295' cy='160' r='32'/%3E%3Ccircle cx='250' cy='220' r='58'/%3E%3Crect x='820' y='135' width='190' height='245' rx='38'/%3E%3Ccircle cx='913' cy='98' r='47'/%3E%3Cpath d='M745 455h270v48H745z'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.35rem, 5.5vw, 5.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero p {
  max-width: 660px;
  font-size: 1.1rem;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
  color: currentColor;
  opacity: 0.78;
}

.hero-panel,
.referral-card,
.payout-card,
.learning-card,
.leaderboard {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
}

.hero-panel .rate {
  display: block;
  color: var(--green);
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: 0.95;
  font-weight: 900;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid #b8c6d4;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.action-row,
.feedback-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.section-head {
  max-width: 820px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 3rem);
  letter-spacing: 0;
  line-height: 1.08;
}

.dashboard-band { background: #fff; }

.referral-layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 18px;
}

.referral-card label {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.86rem;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  margin-top: 6px;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 10px;
  border: 1px solid #b8c6d4;
  border-radius: 6px;
  font: inherit;
}

textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px;
  border: 1px solid #b8c6d4;
  border-radius: 6px;
  font: inherit;
  resize: vertical;
  overflow-wrap: anywhere;
}

.status-note {
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 8px;
  background: #edf4f8;
  color: var(--muted);
  font-weight: 700;
}

.qr-wrap {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}

#qr-image,
#qr-code {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

#qr-code { display: none; }

.metrics-grid,
.impact-grid,
.share-grid,
.library-grid,
.terms-grid,
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.metrics-grid article,
.impact-grid article,
.library-grid article,
.terms-grid article,
.insight-grid article,
.share-grid a {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.metrics-grid span,
.impact-grid span {
  display: block;
  color: var(--blue);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 1;
}

.metrics-grid strong,
.impact-grid strong,
.library-grid strong,
.terms-grid strong,
.share-grid strong {
  display: block;
  margin-top: 10px;
}

.terms-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.insight-grid h3,
.feature-vote-card h3 {
  margin-top: 0;
}

.insight-grid ol {
  margin: 0;
  padding-left: 20px;
}

.insight-grid li {
  margin-bottom: 10px;
}

.insight-grid li span {
  display: block;
  color: var(--muted);
}

.feature-vote-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  background: rgba(255,255,255,.1);
}

.payout-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 18px;
  align-items: center;
  margin-top: 18px;
}

.payout-card h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.payout-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.progress-wrap {
  display: grid;
  gap: 8px;
}

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

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.content-band { background: #edf4f8; }

.split-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 18px;
  align-items: start;
}

.video-funnel-band {
  background: #fff;
}

.funnel-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.funnel-steps article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.funnel-steps span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.funnel-steps strong {
  align-self: end;
  font-size: 1.04rem;
}

.funnel-steps p {
  margin: 0;
  color: var(--muted);
}

.terms-disclaimer {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #e5c36f;
  border-radius: 8px;
  background: #fff8df;
  color: #4d3b08;
  font-weight: 700;
}

.learning-card h3,
.leaderboard h3 {
  margin-top: 0;
  font-size: 1.35rem;
}

.library-grid article {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.library-grid p { margin: 0; color: var(--muted); }

.timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li,
.leader-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline span {
  color: var(--gold);
  font-size: 1.35rem;
  font-weight: 900;
}

.feedback-band {
  background: #21313c;
  color: #fff;
}

.feedback-band p { max-width: 850px; }

.upload-form {
  max-width: 520px;
  margin-top: 20px;
}

.upload-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.admin-band { background: #fff; }

.admin-table {
  display: grid;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table [role="row"] {
  display: grid;
  grid-template-columns: 170px 120px minmax(260px, 1fr) 100px;
  min-width: 720px;
}

.admin-table [role="row"] > * {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-table [role="row"]:first-child {
  background: #edf4f8;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px clamp(16px, 4vw, 42px);
  color: var(--muted);
}

@media (max-width: 760px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

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

  .hero,
  .referral-layout,
  .payout-card,
  .split-band {
    grid-template-columns: 1fr;
  }

  .funnel-steps {
    grid-template-columns: 1fr;
  }

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

  .qr-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .inline-control {
    grid-template-columns: minmax(0, 1fr) 56px;
  }

  .icon-button {
    min-width: 52px;
    min-height: 48px;
    padding: 8px;
  }

  .metrics-grid article,
  .impact-grid article,
  .library-grid article,
  .terms-grid article,
  .insight-grid article,
  .share-grid a {
    min-width: 0;
  }
}

/* 2026-07-03: mobile-first ambassador dashboard flow. */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --focus: #155eef;
}

html {
  overflow-x: hidden;
  scroll-padding-top: 88px;
}

body {
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
}

p,
li {
  color: var(--muted);
}

a,
button,
.button,
.icon-button,
input,
textarea {
  min-height: 44px;
}

.topbar {
  gap: var(--space-3);
  padding: var(--space-3) clamp(var(--space-4), 4vw, var(--space-8));
}

nav {
  gap: var(--space-2);
}

nav a,
.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 8px;
  line-height: 1.2;
  text-align: center;
}

nav a:focus-visible,
.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.hero,
.dashboard-band,
.content-band,
.split-band,
.feedback-band,
.admin-band {
  padding: clamp(var(--space-6), 5vw, var(--space-12)) clamp(var(--space-4), 4vw, var(--space-8));
}

.hero {
  min-height: auto;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
}

.hero h1 {
  max-width: 14ch;
}

.action-row,
.feedback-grid {
  gap: var(--space-3);
}

.action-row .button {
  min-height: 52px;
}

.referral-layout {
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-6);
}

.affiliate-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.affiliate-flow article {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
  align-items: start;
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.08);
}

.affiliate-flow span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.affiliate-flow p {
  margin: 0;
}

.referral-card {
  position: sticky;
  top: 86px;
}

.status-note {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.inline-control {
  grid-template-columns: minmax(0, 1fr) minmax(72px, auto);
  gap: var(--space-2);
}

.inline-control input,
.inline-control textarea {
  min-width: 0;
}

.icon-button {
  min-width: 72px;
  background: #fff;
  color: var(--ink);
}

.qr-wrap {
  grid-template-columns: 156px minmax(0, 1fr);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metrics-grid article {
  min-height: 104px;
  padding: var(--space-4);
}

.payout-card,
.learning-card,
.leaderboard,
.metrics-grid article,
.impact-grid article,
.library-grid article,
.terms-grid article,
.insight-grid article,
.share-grid a {
  border-radius: 8px;
}

@media (max-width: 1024px) {
  .referral-layout,
  .hero,
  .affiliate-flow,
  .split-band {
    grid-template-columns: 1fr;
  }

  .referral-card {
    position: static;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  nav a,
  .action-row .button,
  .feedback-grid .button {
    width: 100%;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.1rem, 11vw, 3.2rem);
  }

  .inline-control,
  .qr-wrap,
  .payout-card {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }

  #qr-image,
  #qr-code {
    justify-self: center;
  }

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