:is(.chains, .cow-history) [data-chain="ethereum"] { --network-color: #c6b2fc; }
:is(.chains, .cow-history) [data-chain="base"] { --network-color: #5681ff; }
:is(.chains, .cow-history) [data-chain="bnb"] { --network-color: #f3ba2f; }
.chains [data-chain="arbitrum"] { --network-color: #89d6ff; }
.chains [data-chain="polygon"] { --network-color: #b298ff; }
.chains [data-chain="avalanche"] { --network-color: #ff727a; }
.chains [data-chain="gnosis"] { --network-color: #a2dbbe; }
.chains [data-chain="linea"] { --network-color: #a3d8ff; }
.chains [data-chain="plasma"] { --network-color: #b0f0c9; }
.chains [data-chain="ink"] { --network-color: #ad83ff; }
.chains [data-chain="solana"] { --network-color: #92f5d6; }

.chains-console {
  --network-color: #c6b2fc;
  overflow: hidden;
  border: 1px solid #4b365f;
  border-radius: 9px;
  background: var(--surface);
}

.chains-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px clamp(13px, 2.2vw, 25px);
  border-bottom: 1px solid #3b2a4d;
  background: #181122;
  color: var(--accent-bright);
}

.chains-console-header > span:last-child { color: var(--muted); }

.chain-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(245px, 1fr);
  align-items: stretch;
}

.chain-visual {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: clamp(326px, 33vw, 450px);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 56%, #351d5088, transparent 71%),
    radial-gradient(circle, #a47bcc36 .6px, transparent .95px) 0 0 / 16px 16px,
    #100b19;
}

.chain-visual::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 8px;
  border: 1px solid #a980cd29;
  border-radius: 3px;
  pointer-events: none;
}

.chain-visual-label {
  position: absolute;
  z-index: 80;
  left: 20px;
  top: 19px;
  color: #d0b8e6;
  pointer-events: none;
}

#chain-orbits,
.chain-orbit-nodes {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#chain-orbits { z-index: 1; }
.chain-orbit-nodes { display: none; }
.has-chain-orbits .chain-orbit-nodes { display: block; }

.chain-orbit-core {
  position: absolute;
  z-index: 24;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(58px, 6.5vw, 85px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid #b180eb;
  border-radius: 16px;
  background: linear-gradient(145deg, #442762, #211332 72%);
  box-shadow: 0 0 48px #c174ff47, inset 0 0 16px #ba81ec2b;
}

.chain-orbit-core img { width: 62%; height: 62%; transform: rotate(-45deg); }
.chain-orbit-core::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid #ad80d76b;
  border-radius: 20px;
}

.chain-brand {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--network-color) 43%, #252036);
  border-radius: 10px;
  background: color-mix(in srgb, var(--network-color) 10%, #15111f);
}

.chain-brand img { display: block; width: 72%; height: 72%; object-fit: contain; }
.chains .chain-brand[data-chain="gnosis"] { background: #e0f1e8; }

.chain-orbit-node {
  position: absolute;
  z-index: var(--chain-depth, 10);
  top: 50%;
  left: 50%;
  width: clamp(34px, 4.3vw, 56px);
  opacity: var(--chain-opacity, 1);
  transform: translate(-50%, -50%) translate3d(var(--chain-x, 0px), var(--chain-y, 0px), 0) scale(var(--chain-scale, 1));
  box-shadow: 0 3px 12px #07040eb0;
}

.chain-orbit-node.is-active {
  border-color: var(--network-color);
  box-shadow: 0 0 22px color-mix(in srgb, var(--network-color) 66%, transparent);
}

.chain-detail {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 13px;
  min-width: 0;
  padding: clamp(24px, 4vw, 50px);
  border-left: 1px solid #3b2a4d;
  background: radial-gradient(ellipse at 12% 48%, color-mix(in srgb, var(--network-color) 14%, transparent), transparent 72%), #140e1e;
}

.chain-detail-index {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
}

.chain-detail-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--network-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--network-color) 60%, transparent);
}

.chain-detail-brand { width: clamp(60px, 7vw, 82px); border-radius: 15px; }

.chain-detail h3 {
  margin: 0;
  font-size: clamp(27px, 3.8vw, 51px);
  line-height: 1.03;
  letter-spacing: -.062em;
}

.chain-detail-token {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.chain-detail-token dd {
  margin: 0;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--network-color) 55%, #251b34);
  border-radius: 4px;
  color: var(--network-color);
  font: 400 12px/1.4 var(--mono);
}

.chain-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid #3b2a4d;
  background: #120d1a;
}

.chain-option {
  --chain-basis: calc((100% - 40px) / 6);
  display: flex;
  flex: 1 1 var(--chain-basis);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 70px;
  padding: 8px;
  border: 1px solid #362644;
  border-radius: 6px;
  background: #17101f;
  text-align: start;
  transition: background .2s ease, border-color .2s ease;
}

.chain-option .chain-brand { width: clamp(34px, 3.3vw, 42px); border-radius: 8px; }
.chain-option-copy { display: grid; gap: 3px; min-width: 0; }
.chain-option-copy strong { color: var(--text); font-size: 13px; line-height: 1.2; }
.chain-token { color: var(--network-color); }

.chain-option:is(:hover:not(:disabled), [aria-pressed="true"]) {
  border-color: color-mix(in srgb, var(--network-color) 68%, #362644);
  background: color-mix(in srgb, var(--network-color) 10%, #17101f);
}

.chain-option:focus-visible { outline-offset: -3px; }

@media (max-width: 1060px) {
  .chain-option { --chain-basis: calc((100% - 24px) / 4); }
}

@media (max-width: 740px) {
  .chain-feature { grid-template-columns: minmax(0, 1fr); }
  .chain-visual { min-height: clamp(244px, 55vw, 370px); }
  .chain-detail {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 13px;
    padding: 15px;
    border-top: 1px solid #3b2a4d;
    border-left: 0;
  }
  .chain-detail-brand { grid-row: 1 / 4; width: 54px; align-self: center; }
  .chain-detail-index { grid-column: 2; font-size: 9px; }
  .chain-detail h3 { grid-column: 2; font-size: 25px; }
  .chain-detail-token { grid-column: 2; font-size: 12px; }
  .chain-option { --chain-basis: calc((100% - 16px) / 3); }
}

@media (max-width: 500px) {
  .chain-option { --chain-basis: calc((100% - 8px) / 2); }
  .chain-visual-label { font-size: 9px; top: 15px; left: 16px; }
  .chain-orbit-node { border-radius: 7px; }
  .chain-orbit-core { width: 51px; border-radius: 11px; }
  .chain-orbit-core::before { inset: -6px; border-radius: 15px; }
}

.cow-history {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid #543a6c;
  border-radius: 8px;
  background: #120d1b;
  scroll-margin-top: 20px;
}

.cow-history-summary {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  padding: clamp(20px, 3.3vw, 42px);
  background:
    radial-gradient(ellipse at 14% 84%, #7e42b332, transparent 74%),
    radial-gradient(circle, #b28bcd4d .6px, transparent .95px) 0 0 / 18px 18px,
    #1a1028;
}

.cow-history-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid #63477b;
  border-radius: 4px;
  background: #211430;
  color: var(--accent-bright);
}

.cow-history-summary h3 {
  margin: 5px 0 0;
  color: var(--text);
  font-size: clamp(20px, 2.7vw, 31px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.cow-history-total {
  display: block;
  max-width: 100%;
  padding-inline-end: .08em;
  font-size: clamp(56px, 7.4vw, 107px);
  line-height: 1.01;
  letter-spacing: -.04em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #e1c2fc;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .cow-history-total {
    background: linear-gradient(114deg, #f6e8ff 4%, #cfacf9 61%, #ae7ff4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
@media (forced-colors: active) {
  .cow-history-total { background: none; color: CanvasText; -webkit-text-fill-color: currentColor; }
}

.cow-history-summary > p:not(.cow-history-kicker) { max-width: 34ch; margin: 0; color: var(--muted); }
.cow-history-summary .cow-history-date { color: #dbc6eb; margin-top: 3px; }
.cow-history-date time { margin-left: 4px; }

.cow-history-breakdown {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: clamp(12px, 2.2vw, 25px);
  border-left: 1px solid #423053;
}

.cow-history-breakdown-title { margin: 0 0 3px; color: var(--accent-bright); }

.cow-history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  padding: 9px 11px 8px;
  border: 1px solid #3d2c4c;
  border-radius: 6px;
  background: #181122;
  transition: border-color .2s ease, background .2s ease;
}

.cow-history-row:hover { border-color: var(--network-color); background: #241731; }
.cow-history-row:focus-visible { outline-offset: -2px; }

.cow-history-chain { display: grid; gap: 2px; min-width: 0; color: var(--text); font-size: 14px; line-height: 1.3; }
.cow-history-chain > span { color: var(--muted); font-size: 12px; }
.cow-history-amount { color: var(--text); font-size: clamp(15px, 2vw, 23px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.cow-history-arrow { width: 13px; height: 13px; color: var(--network-color); }

.cow-history-meter { grid-column: 2 / -1; height: 3px; border-radius: 2px; background: #3a294b; }
.cow-history-meter > span {
  display: block;
  width: var(--volume-share);
  height: 100%;
  border-radius: inherit;
  background: var(--network-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--network-color) 46%, transparent);
}

.cow-history-source { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.cow-history-source a { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 800px) {
  .cow-history { grid-template-columns: minmax(0, 1fr); }
  .cow-history-breakdown { border-top: 1px solid #423053; border-left: 0; }
}

@media (max-width: 440px) {
  .cow-history-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px 8px; padding-inline: 7px; }
  .cow-history-row .chain-brand { width: 31px; border-radius: 7px; }
  .cow-history-chain { font-size: 12px; }
  .cow-history-chain > span { font-size: 10px; }
  .cow-history-arrow { display: none; }
}
