/* Growth pages: /refer/, /partners/, /partners/how-it-works/ and the share page /r/.
   Every class is prefixed gr-. Light heroes with one product mock-up each. */

/* ---- Shared: the light hero's brand slab, a touch richer (as the company pages) ---- */
.gr-hero::after {
  background: linear-gradient(
    160deg,
    var(--mint-100) 0%,
    var(--lilac-100) 55%,
    rgba(233, 229, 255, 0) 100%
  );
}

/* ---- The hero mock-up: a dashboard card on a lilac stage ---- */
.gr-stage {
  padding: 32px;
}
.gr-stage .ui-window__body {
  gap: 12px;
}
.gr-mock__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.gr-mock__title {
  font-weight: 600;
  font-size: var(--fs-label);
}
.gr-mock__code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  background: var(--ink-50);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.gr-mock__code small {
  font-family: var(--font-sans, inherit);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-500);
}
.gr-mock__meter {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
  overflow: hidden;
}
.gr-mock__meter i {
  display: block;
  height: 100%;
  background: var(--mint-500);
  border-radius: inherit;
}
.gr-mock__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* ---- The big numbers: £1,000 / £1,000 and 30 / 20 / 10 ---- */
.gr-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.gr-figures--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gr-figure {
  padding: 32px;
  border-radius: var(--radius-panel);
  background: var(--surface-card);
  border: 1px solid var(--ink-100);
}
.gr-figure__value {
  font-size: clamp(44px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--blue-500);
}
.gr-figure--mint .gr-figure__value {
  color: var(--mint-700);
}
.gr-figure--lilac .gr-figure__value {
  color: var(--lilac-700);
}
.gr-figure__label {
  margin-top: 12px;
  font-weight: 600;
}
.gr-figure p {
  margin-top: 8px;
  color: var(--text-secondary);
}

/* ---- The worked example (two short columns: no need for the table's 640px minimum) ---- */
.table.gr-example {
  min-width: 0;
}
.gr-example td,
.gr-example th {
  font-variant-numeric: tabular-nums;
}
.gr-example td:last-child,
.gr-example th:last-child {
  text-align: right;
}
.gr-example tr.gr-example__total th,
.gr-example tr.gr-example__total td {
  font-weight: 700;
}

/* ---- The worked example's headline figure, fee-mix tooltip and five-year bars ---- */
.gr-headline {
  margin-top: 32px;
  padding: 24px 28px;
  border-radius: var(--radius-panel);
  background: linear-gradient(135deg, var(--blue-50), var(--lilac-50));
  border: 1px solid var(--blue-100);
}
.gr-headline__value {
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--blue-500);
}
.gr-headline__label {
  margin-top: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.gr-multiplier {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 24px 0;
  color: var(--text-secondary);
}
.gr-multiplier .icon {
  flex: none;
  margin-top: 3px;
  color: var(--mint-700);
}
.gr-multiplier strong {
  color: var(--text-primary);
}
.gr-example-wrap {
  overflow: visible;
}
.gr-tip {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}
.gr-tip__btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--ink-300);
  background: var(--surface-card);
  color: var(--ink-600);
  font: 600 12px / 1 var(--font-sans, inherit);
  cursor: help;
  padding: 0;
}
.gr-tip__btn:hover,
.gr-tip__btn:focus-visible {
  border-color: var(--blue-500);
  color: var(--blue-500);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.gr-tip__panel {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(-4px);
  width: min(340px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  background: var(--ink-900);
  color: #fff;
  font-size: var(--fs-caption);
  font-weight: 400;
  text-align: left;
  box-shadow: 0 12px 32px rgba(11, 16, 32, 0.24);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s;
}
.gr-tip:hover .gr-tip__panel,
.gr-tip:focus-within .gr-tip__panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.gr-tip__title {
  font-weight: 600;
}
.gr-tip__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-variant-numeric: tabular-nums;
}
.gr-tip__row small {
  display: block;
  color: var(--ink-300);
}
.gr-tip__row--total {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 600;
}
.gr-years {
  padding: 24px;
  border-radius: var(--radius-panel);
  background: var(--surface-card);
  border: 1px solid var(--ink-100);
}
.gr-years__head {
  font-weight: 600;
  margin-bottom: 16px;
}
.gr-years__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.gr-years__list li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.gr-years__label {
  white-space: nowrap;
}
.gr-years__label small {
  margin-left: 4px;
  color: var(--text-muted);
}
.gr-years__bar {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--ink-50);
  overflow: hidden;
}
.gr-years__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue-500);
}
.gr-years__bar--mint i {
  background: var(--mint-500);
}
.gr-years__bar--lilac i {
  background: var(--lilac-400);
}
.gr-years__bar--fade i {
  background: linear-gradient(90deg, var(--lilac-400), rgba(150, 131, 250, 0.15));
}
.gr-years__value {
  text-align: right;
  font-weight: 600;
}
.gr-years__total {
  padding-top: 12px;
  border-top: 1px solid var(--ink-100);
}
.gr-years__total .gr-years__label,
.gr-years__total .gr-years__value {
  font-weight: 700;
  font-size: var(--fs-body-lg, 18px);
  color: var(--blue-500);
}
.gr-years__total .gr-years__label {
  grid-column: 1 / 3;
  color: var(--text-primary);
}
.gr-years__total > span:nth-child(2) {
  display: none;
}
.gr-years__ongoing .gr-years__value {
  color: var(--lilac-700);
}
.gr-years__note {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

/* ---- The share page ---- */
.gr-share {
  min-height: 60vh;
}
.gr-share__row {
  justify-content: center;
}
.gr-share__note {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: var(--radius-card);
  background: var(--ink-50);
}
.gr-share__small {
  margin-top: 24px;
  font-size: var(--fs-caption);
  color: var(--ink-500);
}

@media (max-width: 900px) {
  .gr-figures,
  .gr-figures--two {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .gr-stage {
    padding: 16px;
  }
  .gr-mock__code small {
    display: none;
  }
  .gr-figure {
    padding: 24px;
  }
  .gr-years__list li {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 12px;
  }
  .gr-years__label small {
    display: block;
    margin-left: 0;
  }
  /* On a phone the panel spans the table: the tip stops being its anchor, so it opens just
     below the button (its static position) and the table's edges set its width. */
  .gr-example-wrap {
    position: relative;
  }
  .gr-tip {
    position: static;
  }
  .gr-tip__panel {
    top: auto;
    left: 12px;
    right: 12px;
    width: auto;
    margin-top: 10px;
    transform: translateY(-4px);
  }
  .gr-tip:hover .gr-tip__panel,
  .gr-tip:focus-within .gr-tip__panel {
    transform: translateY(0);
  }
}
/* Phones: the 20px "?" gets a 44px touch area around it, with no change to how it looks. */
@media (max-width: 640px) {
  .gr-tip__btn {
    position: relative;
  }
  .gr-tip__btn::before {
    content: "";
    position: absolute;
    inset: -12px;
  }
}
