:root {
  --ref-gutter: 34px;
  --ref-rail: clamp(34px, 2.6vw, 52px);
}

.ref-page {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
}

.ref-header,
.ref-main {
  position: relative;
  z-index: 5;
}

.ref-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  width: auto;
  margin: 0 var(--ref-rail);
  padding: 28px 0;
}

.ref-brand {
  position: fixed;
  top: 32px;
  left: var(--ref-rail);
}

.ref-brand .wordmark {
  font-size: clamp(2.22rem, 4.45vw, 3.76rem);
}

.ref-nav {
  display: inline-flex;
  gap: 10px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.64);
  backdrop-filter: blur(18px);
}

.ref-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 15px;
  color: rgba(247, 247, 242, 0.72);
  font-weight: 750;
}

.ref-nav a:hover {
  color: #f7f7f2;
  background: rgba(255, 255, 255, 0.08);
}

.ref-main {
  width: auto;
  margin: 0 var(--ref-rail);
  padding: clamp(118px, 14vh, 150px) 0 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(500px, 520px);
  gap: clamp(28px, 5vw, 82px);
  align-items: center;
}

.ref-main > * {
  min-width: 0;
}

@media (min-width: 560px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .ref-page {
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .ref-header {
    padding: clamp(16px, 2.5vh, 24px) 0;
  }

  .ref-brand .wordmark {
    font-size: clamp(2.22rem, 4.45vw, 3.76rem);
  }

  .ref-main {
    min-height: auto;
    padding: clamp(118px, 14vh, 150px) 0 clamp(18px, 3vh, 30px);
    align-content: start;
  }
}

.ref-kicker {
  position: fixed;
  top: 118px;
  left: var(--ref-rail);
  z-index: 6;
  margin: 0;
  color: var(--purple);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ref-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(3.8rem, 9vw, 8.4rem);
  line-height: 0.96;
  letter-spacing: 0;
  padding-top: 0.04em;
  padding-bottom: 0.04em;
}

.ref-title span {
  display: inline;
}

.ref-title span + span::before {
  content: " ";
}

@media (min-width: 1181px) {
  .ref-hero {
    padding-top: 84px;
    transform: translateX(calc(-1 * clamp(34px, 2.3vw, 46px)));
  }

  .ref-hero h1 {
    max-width: min(980px, calc(100vw - (var(--ref-rail) * 2)));
    line-height: 0.92;
  }

  .ref-title span {
    display: block;
  }

  .ref-title span + span::before {
    content: none;
  }
}

.ref-copy {
  max-width: 650px;
  margin: 26px 0 0;
  color: rgba(247, 247, 242, 0.68);
  font-size: clamp(1.08rem, 1.8vw, 1.42rem);
  line-height: 1.55;
}

.ref-card {
  width: min(100%, 540px);
  max-width: 100%;
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(6, 6, 6, 0.78);
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.48);
  padding: 34px;
  backdrop-filter: blur(22px);
}

.ref-form {
  display: grid;
  gap: 18px;
}

.ref-form label {
  display: grid;
  gap: 10px;
}

.ref-form label span,
.ref-result-label {
  color: rgba(247, 247, 242, 0.58);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ref-address-display,
.ref-link-row input {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.42);
  color: #f7f7f2;
  padding: 0 18px;
  outline: none;
}

.ref-link-row input:focus {
  border-color: rgba(227, 92, 255, 0.76);
  box-shadow: 0 0 0 4px rgba(227, 92, 255, 0.13);
}

.ref-hidden-address {
  display: none !important;
}

.ref-address-display {
  display: block;
  align-items: center;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: text;
  color: rgba(223, 255, 232, 0.94);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.96rem;
  font-weight: 620;
  line-height: 1.35;
  text-shadow: 0 0 18px rgba(140, 255, 120, 0.08);
}

.ref-address-display.is-empty {
  color: rgba(247, 247, 242, 0.42);
  user-select: none;
}

.ref-native-select {
  display: none;
}

.ref-chain-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  min-height: auto;
  padding: 12px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% -30%, rgba(227, 92, 255, 0.12), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(227, 92, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 40px rgba(0, 0, 0, 0.18);
}

.ref-chain-chip {
  min-width: 0;
  min-height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(247, 247, 242, 0.68);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  cursor: pointer;
  font-weight: 760;
  font-size: 1rem;
  padding: 0 16px;
  transition: background 170ms ease, color 170ms ease, transform 170ms cubic-bezier(.2, .8, .2, 1), border-color 170ms ease, box-shadow 170ms ease;
}

.ref-chain-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  opacity: 0.78;
  filter: saturate(0.92);
  transition: opacity 170ms ease, filter 170ms ease, transform 170ms cubic-bezier(.2, .8, .2, 1);
}

.ref-chain-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ref-chain-chip:hover {
  background:
    linear-gradient(180deg, rgba(227, 92, 255, 0.08), rgba(255, 255, 255, 0.05));
  border-color: rgba(227, 92, 255, 0.18);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2), 0 8px 28px rgba(120, 44, 142, 0.12);
  color: #f7f7f2;
  transform: translateY(-1px);
}

.ref-chain-chip:hover .ref-chain-icon {
  opacity: 0.95;
  filter: saturate(1);
  transform: translateY(-1px);
}

.ref-chain-chip:active {
  transform: scale(0.985);
}

.ref-chain-chip:focus-visible {
  outline: 2px solid rgba(247, 247, 242, 0.5);
  outline-offset: 2px;
}

.ref-chain-chip[aria-pressed="true"] {
  background:
    linear-gradient(180deg, rgba(227, 92, 255, 0.22), rgba(92, 44, 112, 0.18)),
    rgba(255, 255, 255, 0.05);
  border-color: rgba(227, 92, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 28px rgba(114, 37, 136, 0.16);
  color: #f7f7f2;
}

.ref-chain-chip[aria-pressed="true"] .ref-chain-icon {
  opacity: 1;
  filter: saturate(1.08);
}

.ref-chain-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ref-legal-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.ref-legal-links a {
  color: rgba(247, 247, 242, 0.58);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.ref-legal-links a:hover {
  color: #f7f7f2;
}

.ref-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.ref-actions.wallet-connected {
  grid-template-columns: 18px minmax(0, 1fr) minmax(0, 1fr);
}

.ref-primary,
.ref-wallet,
.ref-secondary,
.ref-link-row button {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 860;
  font-size: clamp(0.84rem, 1.05vw, 0.98rem);
  transition: background 170ms ease, color 170ms ease, border-color 170ms ease, transform 170ms cubic-bezier(.2, .8, .2, 1), opacity 170ms ease;
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

.ref-primary:hover,
.ref-wallet:hover,
.ref-secondary:hover,
.ref-link-row button:hover {
  transform: translateY(-1px);
}

.ref-primary:active,
.ref-wallet:active,
.ref-secondary:active,
.ref-link-row button:active {
  transform: scale(0.985);
}

.ref-primary {
  background: #f7f7f2;
  color: #050505;
}

.ref-wallet {
  background: rgba(255, 255, 255, 0.11);
  color: #f7f7f2;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.ref-wallet:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
}

.ref-wallet.connected {
  justify-self: center;
  flex: 0 0 10px !important;
  display: inline-block !important;
  overflow: hidden;
  inline-size: 10px !important;
  block-size: 10px !important;
  width: 10px !important;
  min-width: 10px !important;
  max-width: 10px !important;
  min-height: 10px !important;
  max-height: 10px !important;
  height: 10px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #55ff26 !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  box-shadow: none !important;
}

.ref-wallet.connected:hover {
  transform: none;
  background: #55ff26;
}

.ref-primary[disabled] {
  opacity: 0.58;
  cursor: wait;
}

.ref-wallet[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.ref-secondary,
.ref-link-row button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
  color: #f7f7f2;
}

.ref-secondary:hover,
.ref-link-row button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.ref-status {
  margin: 0;
  color: rgba(247, 247, 242, 0.62);
  line-height: 1.45;
}

.ref-status:empty,
.ref-status[hidden] {
  display: none;
}

.ref-wallet-note {
  margin: -2px 0 0;
  color: rgba(247, 247, 242, 0.52);
  font-size: 0.86rem;
  line-height: 1.4;
}

.ref-wallet-note.ready {
  color: var(--green);
}

.ref-status.success {
  color: var(--green);
}

.ref-status.blocked {
  color: #ffcf7a;
}

.ref-status.error {
  color: #ff8a8a;
}

.ref-result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.ref-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 10px;
}

.ref-result p {
  margin: 14px 0 0;
  color: rgba(247, 247, 242, 0.6);
  line-height: 1.5;
}

@media (max-width: 1180px) and (min-width: 561px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .ref-page {
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .ref-main {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    padding: clamp(110px, 13vh, 132px) 0 28px;
    gap: clamp(16px, 2.4vh, 24px);
    align-content: start;
  }

  .ref-card {
    justify-self: center;
    width: min(860px, 100%);
  }

  .ref-hero {
    align-self: end;
  }

  .ref-hero h1 {
    max-width: 980px;
    font-size: clamp(3.6rem, 8.2vw, 6rem);
    line-height: 0.96;
    padding-top: 0.04em;
    padding-bottom: 0.04em;
  }

  .ref-copy {
    max-width: 980px;
    padding-bottom: 0;
  }

  .ref-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 720px) and (min-width: 560px) {
  .ref-header {
    padding: 14px 0;
  }

  .ref-brand .wordmark {
    font-size: clamp(2.22rem, 4.45vw, 3.76rem);
  }

  .ref-nav a {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .ref-main {
    height: auto;
    min-height: 0;
    padding: 92px 0 20px;
    gap: 16px;
    align-content: start;
  }

  .ref-kicker {
    display: block;
  }

  .ref-hero h1 {
    font-size: clamp(3.1rem, 10vw, 4.4rem);
    line-height: 0.96;
  }

  .ref-copy {
    margin-top: 12px;
    font-size: 0.95rem;
    line-height: 1.38;
  }

  .ref-card {
    justify-self: stretch;
    width: 100%;
    padding: 20px;
    border-radius: 24px;
  }

  .ref-form {
    gap: 12px;
  }

  .ref-form label {
    gap: 8px;
  }

  .ref-chain-chips {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 8px;
    padding: 8px;
    border-radius: 20px;
  }

  .ref-chain-chip {
    min-height: 52px;
    border-radius: 14px;
    gap: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.11em;
    padding: 0 14px;
  }

  .ref-chain-icon {
    width: 18px;
    height: 18px;
  }

  .ref-primary,
  .ref-wallet,
  .ref-secondary,
  .ref-link-row button {
    min-height: 44px;
    font-size: 0.8rem;
  }

  .ref-wallet-note {
    font-size: 0.8rem;
  }
}

@media (max-width: 680px) {
  :root {
    --ref-gutter: 16px;
    --ref-rail: 16px;
  }

  .ref-brand {
    top: 18px;
  }

  .ref-brand .wordmark {
    font-size: 1.92rem;
  }

  .ref-kicker {
    top: 58px;
    font-size: 0.68rem;
  }
}

@media (max-width: 560px) {
  html,
  body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .ref-page {
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .ref-header {
    width: auto;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 8px;
    padding: 16px 0 8px;
  }

  .ref-brand {
    position: static;
    top: auto;
    left: auto;
  }

  .ref-brand .wordmark {
    font-size: 1.92rem;
  }

  .ref-kicker {
    position: static;
    top: auto;
    left: auto;
    font-size: 0.68rem;
  }

  .ref-main {
    width: calc(100vw - (var(--ref-rail) * 2));
    inline-size: calc(100vw - (var(--ref-rail) * 2));
    max-width: calc(100vw - (var(--ref-rail) * 2));
    height: auto;
    min-height: 0;
    padding: 28px 0 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    overflow: visible;
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
  }

  .ref-hero,
  .ref-card {
    width: calc(100vw - (var(--ref-rail) * 2));
    inline-size: calc(100vw - (var(--ref-rail) * 2));
    max-width: calc(100vw - (var(--ref-rail) * 2));
    max-inline-size: calc(100vw - (var(--ref-rail) * 2));
    min-width: 0;
    scroll-snap-align: start;
  }

  .ref-hero {
    display: block;
    margin: 0;
    max-width: 100%;
  }

  .ref-card {
    align-self: auto;
    margin: 0;
    padding: 22px;
  }

  .ref-chain-chips {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 8px;
    padding: 8px;
    border-radius: 20px;
  }

  .ref-chain-chip {
    min-height: 52px;
    border-radius: 14px;
    gap: 10px;
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    padding: 0 14px;
  }

  .ref-chain-icon {
    width: 18px;
    height: 18px;
  }

  .ref-nav {
    max-width: 100%;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px;
    border-radius: 18px;
  }

  .ref-nav a {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.76rem;
  }

  .ref-hero h1 {
    max-width: 100%;
    font-size: clamp(2.5rem, 11.5vw, 3.15rem);
    line-height: 1;
  }

  .ref-title span {
    display: block;
  }

  .ref-title span + span::before {
    content: none;
  }

  .ref-copy {
    display: block;
    width: calc(100vw - (var(--ref-rail) * 2));
    inline-size: calc(100vw - (var(--ref-rail) * 2));
    max-width: calc(100vw - (var(--ref-rail) * 2));
    max-inline-size: calc(100vw - (var(--ref-rail) * 2));
    margin-top: 18px;
    font-size: 0.96rem;
    line-height: 1.42;
  }

  .ref-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ref-secondary {
    grid-column: 1 / -1;
  }

  .ref-primary,
  .ref-wallet,
  .ref-secondary,
  .ref-link-row button {
    min-height: 48px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .ref-actions.wallet-connected {
    grid-template-columns: 18px minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 430px) {
  .ref-main,
  .ref-hero,
  .ref-card,
  .ref-copy {
    width: min(100%, 358px);
    inline-size: min(100%, 358px);
    max-width: 358px;
    max-inline-size: 358px;
  }

  .ref-card {
    padding: 20px;
  }

  .ref-chain-chips {
    min-height: auto;
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
  }

  .ref-chain-chip {
    min-height: 52px;
    border-radius: 13px;
    gap: 10px;
    font-size: 0.74rem;
    letter-spacing: 0.11em;
    padding: 0 14px;
  }

  .ref-chain-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 360px) {
  .ref-chain-chip {
    font-size: 0.68rem;
    letter-spacing: 0.09em;
  }

  .ref-chain-icon {
    width: 16px;
    height: 16px;
  }

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

  .ref-actions.wallet-connected {
    grid-template-columns: 18px 1fr;
  }

  .ref-secondary {
    grid-column: 1 / -1;
  }

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

@media (min-width: 768px) {
  .ref-chain-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }

  .ref-chain-chip {
    min-height: 72px;
    justify-content: center;
    gap: 10px;
    padding: 0 12px;
    font-size: clamp(0.82rem, 1.35vw, 0.98rem);
  }

  .ref-chain-icon {
    width: 26px;
    height: 26px;
  }
}
