:root {
  --emerald-700: #1e5f52;
  --emerald-600: #2a7a69;
  --emerald-500: #3d9986;
  --text: #17211f;
  --muted: #68736f;
  --border: #e2eae7;
  --surface: #f7faf9;
  --white: #ffffff;
  --danger: #b42318;
  --radius: 22px;
  --shadow:
    0 18px 50px
    rgba(30, 95, 82, 0.075);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: var(--text);

  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(42, 122, 105, 0.055),
      transparent 40%
    ),
    radial-gradient(
      circle at 0% 100%,
      rgba(61, 153, 134, 0.045),
      transparent 42%
    ),
    #fbfbfa;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color:
    transparent;
}

.hidden {
  display: none !important;
}

.ambassador-page {
  width: min(100% - 32px, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 48px;
}

.ambassador-center {
  display: grid;
  place-items: center;
}

.ambassador-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 40px;
}

.ambassador-brand {
  color: var(--emerald-700);
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
  letter-spacing: -0.015em;
}

.ambassador-text-button {
  border: 0;
  padding: 8px 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.ambassador-text-button:hover {
  color: var(--emerald-700);
}

.ambassador-card {
  border: 1px solid
    rgba(30, 95, 82, 0.10);
  border-radius: var(--radius);
  background:
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.ambassador-login-card {
  width: min(100%, 460px);
  padding: 34px;
}

.ambassador-eyebrow {
  margin: 0 0 10px;
  color: var(--emerald-700);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size:
    clamp(34px, 5vw, 50px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 10px;
  font-size: 26px;
  letter-spacing: -0.035em;
}

.ambassador-intro,
.onboarding-header > p,
.onboarding-card > p,
.dashboard-welcome > p {
  color: var(--muted);
  line-height: 1.6;
}

form label,
.onboarding-card > label:not(.ambassador-consent) {
  display: grid;
  gap: 8px;
  margin-top: 17px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 15px;
  outline: none;
  color: var(--text);
  background: #fbfcfc;
  font-size: 15px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

input:focus {
  border-color: var(--emerald-600);
  background: #ffffff;
  box-shadow:
    0 0 0 4px
    rgba(30, 95, 82, 0.10);
}

.ambassador-primary,
.ambassador-secondary {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.ambassador-primary {
  margin-top: 22px;
  border: 0;
  color: #ffffff;
  background: var(--emerald-700);
  box-shadow:
    0 10px 24px
    rgba(30, 95, 82, 0.17);
}

.ambassador-primary:hover {
  background: var(--emerald-600);
  transform: translateY(-1px);
}

.ambassador-secondary {
  border: 1px solid
    rgba(30, 95, 82, 0.14);
  color: var(--emerald-700);
  background: #ffffff;
}

.ambassador-secondary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 8px 18px
    rgba(30, 95, 82, 0.08);
}

.ambassador-primary:disabled,
.ambassador-secondary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.full {
  width: 100%;
}

.ambassador-message {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ambassador-message.error {
  color: var(--danger);
}

.ambassador-loading {
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
}

.onboarding-shell {
  width: min(100%, 720px);
  margin: 0 auto;
}

.onboarding-header {
  margin-bottom: 24px;
}

.onboarding-progress {
  display: grid;
  grid-template-columns:
    repeat(4, 1fr);
  gap: 6px;
  margin-top: 26px;
}

.onboarding-progress span {
  position: relative;
  padding-top: 13px;
  color: #9aa29f;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.onboarding-progress span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #e6ecea;
}

.onboarding-progress span.active {
  color: var(--emerald-700);
}

.onboarding-progress span.active::before {
  background: var(--emerald-700);
}

.onboarding-card {
  padding: 30px;
}

.onboarding-step-number {
  margin-bottom: 8px;
  color: var(--emerald-700) !important;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.document-summary {
  margin-top: 22px;
  border: 1px solid
    rgba(30, 95, 82, 0.10);
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(
      145deg,
      rgba(232, 244, 240, 0.75),
      rgba(250, 252, 251, 0.96)
    );
}

.document-summary strong {
  display: block;
  margin-bottom: 6px;
}

.document-summary p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.document-link {
  color: var(--emerald-700);
  font-size: 13px;
  font-weight: 850;
  text-decoration:
    underline;
  text-underline-offset: 3px;
}

.ambassador-consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.ambassador-consent input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color:
    var(--emerald-700);
}

.ambassador-dashboard {
  width: min(100%, 820px);
  margin: 0 auto;
}

.dashboard-welcome {
  margin-bottom: 28px;
}

.referral-tools-card {
  display: flex;
  align-items: center;
  justify-content:
    space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding: 22px;
}

.tool-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.referral-code {
  color: var(--emerald-700);
  font-size: 26px;
  letter-spacing: 0.04em;
}

.referral-link-wrap {
  min-width: 0;
}

.referral-link {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.dashboard-placeholder-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.dashboard-placeholder {
  padding: 22px;
}

.dashboard-placeholder > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.dashboard-placeholder > strong {
  display: block;
  margin: 11px 0 8px;
  font-size: 36px;
  letter-spacing: -0.04em;
}

.dashboard-placeholder p,
.dashboard-footnote {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.dashboard-footnote {
  margin-top: 22px;
  text-align: center;
}

@media (max-width: 640px) {
  .ambassador-page {
    width: min(
      100% - 28px,
      980px
    );
    padding-top: 20px;
  }

  .ambassador-topbar {
    padding-bottom: 30px;
  }

  .ambassador-login-card,
  .onboarding-card {
    padding: 24px 20px;
  }

  .referral-tools-card {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .referral-tools-card
    .ambassador-secondary {
    width: 100%;
  }

  .dashboard-placeholder-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-progress span {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}


.ambassador-text-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.ambassador-text-link:hover {
  color: var(--emerald-700);
}

.ambassador-admin-shell {
  width: min(100%, 680px);
  margin: 0 auto;
}

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.invite-success-card {
  margin-top: 18px;
  padding: 24px;
}

.invite-summary {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.invite-summary div {
  min-width: 0;
  padding: 14px;
  border: 1px solid
    rgba(30, 95, 82, 0.09);
  border-radius: 15px;
  background: var(--surface);
}

.invite-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.invite-summary strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

@media (max-width: 640px) {
  .invite-summary {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------
   Phase 2 referral QR tools
---------------------------------- */

.ambassador-qr-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 14px;
  padding: 24px;
}

.ambassador-qr-copy {
  max-width: 390px;
}

.ambassador-qr-copy strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 16px;
}

.ambassador-qr-copy > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ambassador-qr-actions {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.ambassador-qr {
  display: grid;
  place-items: center;
  width: 172px;
  height: 172px;
  border: 1px solid
    rgba(30, 95, 82, 0.10);
  border-radius: 20px;
  padding: 11px;
  background: #ffffff;
  box-shadow:
    0 10px 26px
    rgba(30, 95, 82, 0.065);
}

.ambassador-qr img,
.ambassador-qr canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

@media (max-width: 640px) {
  .ambassador-qr-card {
    align-items: stretch;
    flex-direction: column;
  }

  .ambassador-qr-actions {
    justify-items: stretch;
  }

  .ambassador-qr {
    justify-self: center;
  }
}


/* ---------------------------------
   Phase 3 referral activity
---------------------------------- */

.referral-activity-section {
  margin-top: 30px;
}

.referral-activity-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.referral-activity-heading h2 {
  margin-bottom: 7px;
}

.referral-activity-heading > div > p:last-child {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.referral-summary-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.referral-summary-card {
  padding: 18px;
  box-shadow:
    0 12px 32px
    rgba(30, 95, 82, 0.055);
}

.referral-summary-card > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.referral-summary-card > strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.referral-list-card {
  overflow: hidden;
  padding: 0;
}

.referral-list-header {
  padding: 20px 22px 17px;
  border-bottom: 1px solid
    rgba(30, 95, 82, 0.075);
}

.referral-list-header strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.referral-list-header span {
  display: block;
  max-width: 590px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.referral-list {
  display: grid;
}

.referral-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 17px 22px;
  border-bottom: 1px solid
    rgba(30, 95, 82, 0.06);
}

.referral-row:last-child {
  border-bottom: 0;
}

.referral-row-details {
  min-width: 0;
}

.referral-row-details > strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referral-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.referral-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.status-submitted {
  color: #54615d;
  background: #f4f7f6;
  border-color: #e4eae8;
}

.status-reviewing {
  color: var(--emerald-700);
  background:
    rgba(61, 153, 134, 0.085);
  border-color:
    rgba(30, 95, 82, 0.10);
}

.status-offer-sent {
  color: #6d5b25;
  background: #fbf7e9;
  border-color: #ece2ba;
}

.status-purchased {
  color: #1e5f52;
  background: #eaf5f1;
  border-color:
    rgba(30, 95, 82, 0.13);
}

.status-closed,
.status-archived {
  color: #737b78;
  background: #f5f6f6;
  border-color: #e6e9e8;
}

.referral-empty,
.referral-load-error {
  padding: 34px 22px;
  text-align: center;
}

.referral-empty strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.referral-empty p,
.referral-load-error {
  margin: 0 auto;
  max-width: 460px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.referral-load-error {
  color: var(--danger);
}

.rewards-preview-grid {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

@media (hover: hover) and (pointer: fine) {
  .referral-row {
    transition:
      background 170ms ease;
  }

  .referral-row:hover {
    background:
      rgba(247, 250, 249, 0.82);
  }
}

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

@media (max-width: 520px) {
  .referral-activity-section {
    margin-top: 26px;
  }

  .referral-summary-grid {
    gap: 9px;
  }

  .referral-summary-card {
    padding: 16px;
  }

  .referral-summary-card > strong {
    font-size: 27px;
  }

  .referral-list-header {
    padding: 18px;
  }

  .referral-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    padding: 16px 18px;
  }

  .referral-status {
    align-self: flex-start;
  }
}


/* ---------------------------------
   Phase 4 reward activity
---------------------------------- */

.reward-activity-section { margin-top:14px; }
.reward-summary-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:14px;
}
.reward-summary-grid .referral-summary-card > strong { font-size:25px; }
.reward-row-value {
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:10px;
}
.reward-row-value > strong {
  color:var(--text);
  font-size:15px;
  letter-spacing:-.02em;
}

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

@media (max-width:520px) {
  .reward-row-value { width:100%; justify-content:space-between; }
}


/* ---------------------------------
   Phase 4.1.1 unified admin navigation
---------------------------------- */
.ambassador-admin-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
}

.ambassador-text-link.is-current {
  color: var(--ambassador-text, #17211f);
  text-decoration: none;
}

@media (max-width: 620px) {
  .ambassador-admin-nav {
    justify-content: flex-start;
  }
}


/* ---------------------------------
   Phase 4.2 Ambassador management
---------------------------------- */
.ambassador-management-shell { width:min(100%,980px); }
.ambassador-invite-panel { margin-bottom:24px; padding:0; overflow:hidden; }
.ambassador-invite-panel > summary {
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  padding:22px 24px; cursor:pointer; list-style:none;
}
.ambassador-invite-panel > summary::-webkit-details-marker { display:none; }
.ambassador-invite-panel > summary strong { display:block; font-size:16px; color:var(--text); }
.ambassador-invite-panel > summary small { display:block; margin-top:4px; color:var(--muted); font-size:12px; font-weight:500; }
.management-summary-action { flex:0 0 auto; color:var(--emerald-700); font-size:12px; font-weight:850; }
.management-invite-form { padding:0 24px 24px; }
.ambassador-management-list-section { margin-top:28px; }
.management-list-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:14px; }
.management-list-heading h2 { margin:3px 0 5px; font-size:25px; letter-spacing:-.035em; }
.management-list-heading p:last-child { margin:0; color:var(--muted); font-size:13px; }
.management-count { display:grid; place-items:center; min-width:44px; height:44px; padding:0 12px; border-radius:14px; background:rgba(30,95,82,.07); color:var(--emerald-700); font-weight:900; }
.management-search-wrap { margin-bottom:12px; }
.management-search-wrap input { width:100%; }
.ambassador-management-list { display:grid; gap:10px; }
.management-loading { padding:28px; border:1px solid rgba(30,95,82,.08); border-radius:20px; color:var(--muted); text-align:center; background:#fff; }
.management-error { color:#9f1239; }
.ambassador-profile-card { overflow:hidden; border:1px solid rgba(30,95,82,.10); border-radius:20px; background:#fff; box-shadow:0 8px 24px rgba(30,95,82,.035); }
.ambassador-profile-card > summary { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(260px,1fr) auto; align-items:center; gap:20px; padding:18px 20px; cursor:pointer; list-style:none; }
.ambassador-profile-card > summary::-webkit-details-marker { display:none; }
.profile-summary-main { display:flex; align-items:center; gap:12px; min-width:0; }
.profile-avatar { display:grid; place-items:center; flex:0 0 auto; width:40px; height:40px; border-radius:50%; background:rgba(30,95,82,.09); color:var(--emerald-700); font-size:12px; font-weight:900; }
.profile-summary-main strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text); font-size:14px; }
.profile-summary-main span:last-child { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.profile-summary-stats { display:flex; justify-content:flex-end; gap:18px; color:var(--muted); font-size:11px; }
.profile-summary-stats span { white-space:nowrap; }
.profile-summary-stats strong { color:var(--text); font-size:12px; }
.profile-chevron { color:var(--muted); font-size:20px; transition:transform .2s ease; }
.ambassador-profile-card[open] .profile-chevron { transform:rotate(180deg); }
.profile-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; padding:20px; border-top:1px solid rgba(30,95,82,.07); background:linear-gradient(180deg,rgba(247,251,249,.75),#fff); }
.profile-data-list { margin:9px 0 0; }
.profile-data-list > div { display:flex; justify-content:space-between; gap:18px; padding:9px 0; border-bottom:1px solid rgba(30,95,82,.06); }
.profile-data-list dt { color:var(--muted); font-size:11px; }
.profile-data-list dd { margin:0; max-width:68%; overflow-wrap:anywhere; color:var(--text); font-size:12px; font-weight:750; text-align:right; }
.profile-payout-form { padding:20px; border-top:1px solid rgba(30,95,82,.07); }
.profile-form-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:14px; }
.profile-form-heading strong { font-size:14px; color:var(--text); }
.profile-payout-state { display:inline-flex; align-items:center; min-height:28px; padding:0 10px; border-radius:999px; background:#f3f4f6; color:#6b7280; font-size:10px; font-weight:850; letter-spacing:.02em; }
.profile-payout-state.is-ready { background:#e8f4ef; color:#1e5f52; }
.profile-edit-grid { display:grid; grid-template-columns:1fr 1fr 1.2fr; gap:12px; }
.profile-edit-grid label { color:var(--muted); font-size:11px; font-weight:750; }
.profile-edit-grid input,.profile-edit-grid select { width:100%; margin-top:6px; }
.profile-form-actions { display:flex; align-items:center; gap:14px; margin-top:14px; }
.profile-form-actions .ambassador-message { margin:0; }
.ambassador-profile-settings { margin-top:14px; padding:24px; }
.profile-settings-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:18px; }
.profile-settings-heading h2 { margin:4px 0 6px; font-size:21px; }
.profile-settings-heading p:not(.ambassador-eyebrow) { margin:0; max-width:580px; color:var(--muted); font-size:13px; line-height:1.55; }
.ambassador-self-profile-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.ambassador-self-profile-grid input:disabled { color:#737d79; background:#f7f8f8; cursor:not-allowed; }
@media (max-width:760px) {
  .ambassador-profile-card > summary { grid-template-columns:1fr auto; }
  .profile-summary-stats { grid-column:1/-1; justify-content:flex-start; padding-left:52px; }
  .profile-detail-grid,.profile-edit-grid,.ambassador-self-profile-grid { grid-template-columns:1fr; }
}
@media (max-width:520px) {
  .ambassador-profile-card > summary { gap:12px; padding:16px; }
  .profile-summary-stats { gap:12px; padding-left:0; flex-wrap:wrap; }
  .profile-detail-grid,.profile-payout-form { padding:16px; }
  .management-list-heading,.profile-settings-heading { align-items:flex-start; flex-direction:column; }
  .profile-form-actions { align-items:stretch; flex-direction:column; }
}

/* ---------------------------------
   Phase 4.3 tidy Ambassador Portal
---------------------------------- */

.ambassador-accordion {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(30, 95, 82, 0.10);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.ambassador-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 104px;
  padding: 22px 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.ambassador-accordion-summary::-webkit-details-marker {
  display: none;
}

.ambassador-accordion-summary::marker {
  content: "";
}

.ambassador-accordion-summary:hover {
  background: rgba(247, 250, 249, 0.72);
}

.ambassador-accordion-summary > div:first-child {
  min-width: 0;
}

.ambassador-accordion-summary .ambassador-eyebrow {
  margin-bottom: 6px;
}

.ambassador-accordion-summary strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  letter-spacing: -0.025em;
}

.ambassador-accordion-summary > div:first-child > span:last-child {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.accordion-summary-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.accordion-chevron {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(30, 95, 82, 0.10);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  transition:
    transform 220ms ease,
    background 180ms ease;
}

.accordion-chevron::before,
.accordion-chevron::after {
  content: "";
  position: absolute;
  top: 13px;
  width: 7px;
  height: 1.5px;
  border-radius: 999px;
  background: var(--emerald-700);
}

.accordion-chevron::before {
  left: 7px;
  transform: rotate(45deg);
}

.accordion-chevron::after {
  right: 7px;
  transform: rotate(-45deg);
}

.ambassador-accordion[open] .accordion-chevron {
  transform: rotate(180deg);
}

.ambassador-accordion[open] > .ambassador-accordion-summary {
  border-bottom: 1px solid rgba(30, 95, 82, 0.075);
  background: rgba(247, 250, 249, 0.48);
}

.ambassador-accordion-content {
  padding: 24px;
}

/* Headings are represented by the accordion summary itself. */
.ambassador-accordion-content > .referral-activity-heading {
  display: none;
}

.ambassador-accordion-content .ambassador-profile-settings {
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-documents {
  margin-top: 18px;
  padding: 22px 2px 4px;
  text-align: center;
}

.dashboard-documents .ambassador-eyebrow {
  margin-bottom: 12px;
}

.dashboard-document-links {
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-document-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, 340px);
  min-height: 58px;
  padding: 13px 16px;
  border: 1px solid rgba(30, 95, 82, 0.10);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.70);
  text-decoration: none;
  text-align: left;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.dashboard-document-links a span {
  font-size: 12px;
  font-weight: 800;
}

.dashboard-document-links a small {
  flex: 0 0 auto;
  color: var(--emerald-700);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dashboard-document-links a:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 95, 82, 0.20);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(30, 95, 82, 0.06);
}

@media (max-width: 600px) {
  .ambassador-accordion-summary {
    min-height: 94px;
    padding: 19px;
  }

  .ambassador-accordion-summary strong {
    font-size: 16px;
  }

  .ambassador-accordion-summary > div:first-child > span:last-child {
    font-size: 11px;
  }

  .ambassador-accordion-content {
    padding: 18px;
  }

  .accordion-summary-actions {
    gap: 8px;
  }

  .profile-payout-state {
    white-space: nowrap;
  }

  .dashboard-document-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dashboard-document-links a {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .accordion-chevron,
  .dashboard-document-links a {
    transition: none !important;
  }
}

/* ---------------------------------
   Phase 5 Ambassador applications
---------------------------------- */

.ambassador-application-section {
  margin: 22px 0;
}

.application-count {
  position: relative;
}

.application-count::after {
  content: "new";
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.application-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 14px 0 10px;
}

.application-toolbar select {
  min-width: 150px;
  border: 1px solid rgba(30, 95, 82, 0.12);
  border-radius: 12px;
  padding: 9px 12px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.ambassador-application-list {
  display: grid;
  gap: 10px;
}

.ambassador-application-card {
  overflow: hidden;
  border: 1px solid rgba(30, 95, 82, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 9px 28px rgba(30, 95, 82, 0.035);
}

.ambassador-application-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  cursor: pointer;
  list-style: none;
}

.ambassador-application-card > summary::-webkit-details-marker {
  display: none;
}

.ambassador-application-card > summary strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.ambassador-application-card > summary div > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.application-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.application-status-submitted {
  color: #785b18;
  background: #fbf4de;
}

.application-status-approved {
  color: var(--emerald-700);
  background: rgba(30, 95, 82, 0.08);
}

.application-status-declined {
  color: #7d4a4a;
  background: #f8ecec;
}

.application-detail {
  padding: 3px 18px 18px;
  border-top: 1px solid rgba(30, 95, 82, 0.07);
}

.application-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 0;
}

.application-contact-grid div {
  min-width: 0;
}

.application-contact-grid span,
.application-plan > span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.application-contact-grid strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.application-plan {
  padding: 15px;
  border-radius: 14px;
  background: rgba(30, 95, 82, 0.035);
}

.application-plan p {
  margin: 7px 0 0;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.application-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.application-actions button {
  width: auto;
  min-height: 40px;
  padding: 0 15px;
}

.application-actions .application-message {
  flex: 1 1 100%;
  margin: 2px 0 0;
}

.application-reviewed {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 600px) {
  .application-contact-grid {
    grid-template-columns: 1fr;
  }

  .ambassador-application-card > summary {
    align-items: flex-start;
  }

  .application-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .application-actions button {
    width: 100%;
  }
}



/* Phase 5.1 — team lifecycle */
.team-view-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 10px;
  padding: 4px;
  border: 1px solid rgba(30,95,82,.10);
  border-radius: 999px;
  background: rgba(30,95,82,.035);
}
.team-view-tab {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.team-view-tab.active {
  color: #fff;
  background: var(--emerald-700);
  box-shadow: 0 5px 14px rgba(30,95,82,.14);
}
.profile-lifecycle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(30,95,82,.08);
  border-radius: 15px;
  background: rgba(248,250,249,.76);
}
.profile-lifecycle > div:first-child { flex: 1 1 320px; }
.profile-lifecycle strong { display: block; font-size: 12px; }
.profile-lifecycle > div:first-child > p:last-child {
  max-width: 520px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.profile-lifecycle-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}
.profile-lifecycle-actions button {
  min-height: 38px;
  border-radius: 11px;
  padding: 0 12px;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
