.ag-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 90px;
  color: #eee;
}
.ag-intro {
  text-align: center;
  padding: 25px 0 32px;
}
.ag-intro > a {
  font-size: 14px;
  color: #aaa;
}
.ag-intro h1 {
  font-size: clamp(38px, 5vw, 64px);
  letter-spacing: -0.055em;
  line-height: 1.1;
  margin: 12px 0 20px;
}
.ag-eyebrow {
  letter-spacing: 0.2em;
  font-size: 12px;
  color: #999;
  margin: 26px 0 0;
}
.ag-intro > p:last-child,
.ag-muted {
  color: #aaa;
  line-height: 1.6;
}
.ag-layout {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 300px);
  justify-content: center;
  gap: 40px;
}
.ag-card {
  border: 1px solid #333;
  border-radius: 26px;
  padding: 26px;
  background: linear-gradient(145deg, #1b1b1b, #101010 60%);
  align-self: start;
}
.ag-card-head,
.ag-card-head > span,
.ag-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ag-card-head > span {
  justify-content: start;
  font-size: 20px;
  font-weight: 600;
}
.ag-card-head img {
  border-radius: 50%;
}
.ag-card-head {
  margin-bottom: 22px;
}
.ag-card-head button {
  font-size: 13px;
  padding: 8px 13px;
}
.ag-chain {
  display: grid;
  gap: 7px;
  padding: 18px 0;
}
.ag-chain > span,
.ag-chain small {
  color: #aaa;
  font-size: 14px;
}
.ag-chain strong {
  font-size: 20px;
}
.ag-reverse {
  display: block;
  margin: 0 auto;
  border-radius: 100%;
  width: 42px;
  height: 42px;
  background: #232323;
  color: #eee;
  border: 1px solid #444;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.ag-main label {
  display: block;
  font-size: 14px;
  margin: 16px 0 9px;
}
.ag-amount {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #393939;
}
.ag-amount input {
  width: 100%;
  min-width: 0;
  font-size: 36px;
  border: 0 !important;
  outline: 0;
  background: none !important;
  padding: 0 !important;
  color: #eee;
}
.ag-amount span {
  font-size: 15px;
  white-space: nowrap;
}
.ag-line {
  font-size: 14px;
  padding: 18px 0;
}
.ag-line strong {
  font-weight: 500;
  font-family: monospace;
}
.ag-muted {
  font-size: 14px;
  margin: 12px 0 20px;
}
.ag-notes {
  padding-top: 12px;
}
.ag-notes section {
  padding: 8px 0 24px;
  border-bottom: 1px solid #2c2c2c;
  margin-bottom: 20px;
}
.ag-notes h2 {
  font-size: 19px;
  font-weight: 500;
}
.ag-notes dl > div,
.ag-dialog dl > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 15px 0;
  font-size: 14px;
}
.ag-notes dd,
.ag-dialog dd {
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
}
.ag-links {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 13px;
}
.ag-notes > button,
.ag-notes > a {
  display: block;
  margin: 14px 0;
}
.ag-dialog {
  width: min(500px, calc(100% - 32px));
  max-height: 88dvh;
  overflow: auto;
  box-sizing: border-box;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid #444;
  background: #131313;
  color: #eee;
}
.ag-dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(9px);
}
.ag-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.ag-dialog-head h2 {
  font-size: 24px;
  margin: 0;
}
.ag-dialog-head button {
  border: 0;
  background: none;
  color: #aaa;
  font-size: 28px;
  cursor: pointer;
}
.ag-dialog input,
.ag-dialog select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #3b3b3b;
  border-radius: 12px;
  padding: 12px;
  color: #eee;
  background: #1a1a1a;
  font: inherit;
}
.ag-dialog a {
  color: #ddd;
  overflow-wrap: anywhere;
}
.ag-dialog form > button {
  margin: 16px 0;
}
.ag-dialog details {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #333;
}
.ag-history-item {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #333;
  background: none;
  color: #eee;
  padding: 16px 0;
  cursor: pointer;
}
.ag-history-item small {
  display: block;
  color: #aaa;
  margin-top: 6px;
}
.ag-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0;
}
.ag-steps span {
  border-top: 2px solid #444;
  padding-top: 9px;
  color: #888;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.ag-steps .done {
  border-color: #ddd;
  color: #eee;
}
.ag-pending {
  display: inline-block;
  animation: ag-flight 1.8s ease-in-out infinite;
}
@keyframes ag-flight {
  50% {
    transform: translate(3px, -4px);
  }
}
.ag-asset-choice {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 20px;
  font-size: 14px;
}
.ag-asset-choice span {
  color: #888;
}
.ag-main button:disabled {
  opacity: 0.5;
  cursor: default;
}
.ag-main :focus-visible {
  outline: 2px solid #ddd;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .ag-main {
    padding: 16px 16px 60px;
  }
  .ag-layout {
    grid-template-columns: minmax(0, 520px);
    gap: 22px;
  }
  .ag-card {
    padding: 22px;
  }
  .ag-intro {
    padding-bottom: 20px;
  }
  .ag-notes {
    padding: 0 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ag-pending {
    animation: none;
  }
}

/* Keep the gateway independent of legacy native-bridge layout selectors. */
body[data-spcx-ui] main.ag-main {
  max-width: 1080px;
  padding: 24px 24px 72px;
}
.ag-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 4px 0 16px;
  border-bottom: 1px solid #333;
}
.ag-route .ag-chain {
  padding: 0;
  gap: 5px;
  align-self: start;
}
.ag-route .ag-chain strong {
  font-size: 17px;
  line-height: 1.4;
}
.ag-route .ag-chain small {
  line-height: 1.4;
  min-height: 40px;
}
body[data-spcx-ui] .ag-card #reverse {
  padding: 0;
  margin: 0;
  min-height: 42px;
  border: 1px solid #444;
  background: #232323;
}
.ag-main #gateway-status {
  max-width: 860px;
  margin: 0 auto 22px;
  font-size: 14px;
}
@media (max-width: 760px) {
  body[data-spcx-ui] main.ag-main {
    padding: 16px 14px 60px;
  }
  .ag-route {
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 10px;
  }
  body[data-spcx-ui] .ag-card #reverse {
    width: 34px;
    height: 34px;
    min-height: 34px;
    font-size: 21px;
  }
  .ag-route .ag-chain strong {
    font-size: 16px;
    min-height: 45px;
  }
  .ag-route .ag-chain small {
    font-size: 12px;
  }
}
