:root {
  --network-modal-bg: rgba(14, 16, 20, 0.58);
  --network-modal-panel: #ffffff;
  --network-modal-panel-2: #f7f7f8;
  --network-modal-line: #e6e6eb;
  --network-modal-text: #17181c;
  --network-modal-muted: #686b73;
  --network-modal-soft: #f4f4f8;
  --network-modal-primary: #1d00f5;
  --network-modal-primary-soft: #eef0ff;
  --network-modal-evm: #3157ff;
  --network-modal-trc: #ef3340;
}

.modal-overlay,
.modal-sheet,
.modal-card {
  display: none !important;
}

.network-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 888;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--network-modal-bg);
  -webkit-backdrop-filter: blur(14px) saturate(108%);
  backdrop-filter: blur(14px) saturate(108%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.network-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.network-modal {
  width: min(640px, calc(100vw - 36px));
  max-height: calc(100vh - 44px);
  color: var(--network-modal-text);
  background: var(--network-modal-panel);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.26);
  overflow: auto;
  letter-spacing: 0;
  text-transform: none;
  transform: translateY(12px) scale(0.98);
  transition: transform 180ms ease;
}

.network-modal--network {
  width: min(560px, calc(100vw - 36px));
}

.network-modal-overlay.is-open .network-modal {
  transform: translateY(0) scale(1);
}

.network-modal__header {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 30px 34px 16px;
}

.network-modal--details .network-modal__header {
  justify-items: start;
  padding-bottom: 18px;
}

.network-modal__heading {
  width: min(560px, 100%);
  text-align: center;
}

.network-modal--details .network-modal__heading {
  width: min(560px, 100%);
  text-align: left;
}

.network-modal__title {
  width: 100%;
  margin: 0;
  color: var(--network-modal-text);
  font-size: 36px;
  line-height: 1.08;
  font-weight: 780;
  letter-spacing: 0;
  text-align: center;
}

.network-modal--details .network-modal__title {
  font-size: 36px;
  text-align: left;
}

.network-modal__subtitle {
  display: block;
  width: 100%;
  max-width: none;
  margin: 10px 0 0;
  color: var(--network-modal-muted);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: center;
}

.network-modal--details .network-modal__subtitle {
  max-width: 520px;
  text-align: left;
}

.network-modal__close {
  position: absolute;
  right: 18px;
  top: 16px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #868892;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.network-modal__close:hover,
.network-modal__close:focus-visible {
  color: #4b4e58;
  background: #f0f0f3;
  outline: none;
}

.network-modal__close svg {
  width: 22px;
  height: 22px;
}

.network-modal__body {
  padding: 0 34px 30px;
}

.network-modal-progress {
  display: grid;
  grid-template-columns: repeat(5, 38px);
  justify-content: center;
  gap: 34px;
  margin: 0 auto 24px;
  padding: 0;
  list-style: none;
}

.network-modal-progress__item {
  position: relative;
  display: grid;
  place-items: center;
}

.network-modal-progress__item:not(:first-child)::before {
  content: "";
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  width: 18px;
  height: 2px;
  background: #d9d9dd;
  transform: translateY(-50%);
}

.network-modal-progress__dot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #8d8f96;
  background: #f0f0f1;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  font-weight: 720;
}

.network-modal-progress__dot svg {
  width: 18px;
  height: 18px;
}

.network-modal-progress__item.is-active .network-modal-progress__dot {
  color: #ffffff;
  background: var(--network-modal-primary);
}

.network-modal-progress__item.is-complete .network-modal-progress__dot {
  color: #a4a6ad;
  background: #f0f0f1;
}

.network-modal__question {
  margin: 0 0 16px;
  color: var(--network-modal-text);
  font-size: 21px;
  line-height: 1.36;
  font-weight: 430;
  letter-spacing: 0;
}

.network-modal__question--compact {
  margin-bottom: 14px;
  font-size: 16px;
}

.network-modal__choices {
  display: grid;
  gap: 10px;
}

.network-modal-choice {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  color: var(--network-modal-text);
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
  background: var(--network-modal-panel-2);
  border: 1px solid #eeeeef;
  border-radius: 27px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.network-modal-choice:hover,
.network-modal-choice:focus-visible {
  border-color: #c8ccff;
  background: #fbfbff;
  outline: none;
}

.network-modal-choice.is-selected {
  background: #f8f8ff;
  border-color: #a9afff;
  box-shadow: inset 0 0 0 1px #a9afff;
}

.network-modal-choice__radio {
  display: block;
  width: 24px;
  height: 24px;
  background: #ffffff;
  border: 3px solid #dedfe2;
  border-radius: 50%;
}

.network-modal-choice.is-selected .network-modal-choice__radio {
  border-color: var(--network-modal-primary);
  box-shadow: inset 0 0 0 5px #ffffff;
  background: var(--network-modal-primary);
}

.network-modal-choice__label {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 430;
}

.network-modal__field-group {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.network-modal__field-label {
  color: #50535b;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 430;
}

.network-modal__input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  color: var(--network-modal-text);
  background: #ffffff;
  border: 1px solid #d9d9de;
  border-radius: 26px;
  font: inherit;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.network-modal__input::placeholder {
  color: #8b8e96;
}

.network-modal__input:focus {
  border-color: #a9afff;
  box-shadow: 0 0 0 4px rgba(29, 0, 245, 0.12);
}

.network-modal-info {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #f8f9ff, #ffffff);
  border: 1px solid #a9afff;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(169, 175, 255, 0.4);
}

.network-modal-info__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #ffffff;
  background: var(--network-modal-primary);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  font-weight: 760;
}

.network-modal-info__content {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.network-modal-info__title {
  color: var(--network-modal-text);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.network-modal-info__text {
  color: var(--network-modal-muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.network-modal-info--wallet {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  margin-bottom: 14px;
  padding: 11px 13px;
  background: linear-gradient(180deg, #fffaf1, #ffffff);
  border-color: #ffd48a;
  box-shadow: inset 0 0 0 1px rgba(255, 212, 138, 0.44);
}

.network-modal-info--wallet .network-modal-info__icon {
  width: 34px;
  height: 34px;
  color: #7a4a00;
  background: #ffe6b6;
  font-size: 18px;
}

.network-modal-info--wallet .network-modal-info__title {
  font-size: 15px;
}

.network-modal-info--wallet .network-modal-info__text {
  font-size: 12px;
  line-height: 1.38;
}

.network-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.network-option {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 132px;
  padding: 16px;
  color: inherit;
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.9)),
    color-mix(in srgb, var(--network-accent) 4%, #ffffff);
  border: 1px solid var(--network-modal-line);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.network-option:hover,
.network-option:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--network-accent) 42%, #cbd5e1);
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.12);
  outline: none;
}

.network-option.is-selected {
  border-color: var(--network-accent);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86)),
    color-mix(in srgb, var(--network-accent) 12%, #ffffff);
  box-shadow: inset 0 0 0 1px var(--network-accent), 0 16px 38px rgba(16, 24, 40, 0.12);
}

.network-option::before {
  content: "";
  position: absolute;
  right: -46px;
  top: -58px;
  width: 124px;
  height: 124px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--network-accent) 18%, transparent);
}

.network-option::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 18px;
  height: 18px;
  border: 1px solid #cfd6e3;
  border-radius: 50%;
  background: #ffffff;
}

.network-option.is-selected::after {
  border-color: var(--network-accent);
  background:
    radial-gradient(circle at center, var(--network-accent) 0 5px, transparent 6px),
    #ffffff;
}

.network-option__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: color-mix(in srgb, var(--network-accent) 12%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--network-accent) 22%, #e5e7eb);
  border-radius: 8px;
}

.network-option__icon img {
  width: 28px;
  height: 28px;
}

.network-option__content {
  position: relative;
  z-index: 1;
}

.network-option__name {
  display: block;
  margin-bottom: 5px;
  color: var(--network-modal-text);
  font-size: 21px;
  line-height: 1.2;
  font-weight: 740;
}

.network-option__desc {
  display: block;
  color: var(--network-modal-muted);
  max-width: 260px;
  font-size: 13px;
  line-height: 1.4;
}

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

.network-modal__secondary,
.network-modal__continue {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, opacity 150ms ease;
}

.network-modal__secondary {
  color: var(--network-modal-text);
  background: #f1f1f2;
}

.network-modal__secondary:hover,
.network-modal__secondary:focus-visible {
  background: #e8e8eb;
  outline: none;
}

.network-modal__continue {
  color: #ffffff;
  background: var(--network-modal-primary);
}

.network-modal__continue:hover,
.network-modal__continue:focus-visible {
  transform: translateY(-1px);
  background: #1600ca;
  outline: none;
}

.network-modal__continue:disabled {
  color: #ffffff;
  background: #9ba5ff;
  opacity: 1;
  cursor: not-allowed;
  transform: none;
}

.network-modal__connect--evm {
  background: var(--network-modal-evm);
}

.network-modal__connect--evm:hover,
.network-modal__connect--evm:focus-visible {
  background: #2447d7;
}

.network-modal__connect--trc {
  background: var(--network-modal-trc);
}

.network-modal__connect--trc:hover,
.network-modal__connect--trc:focus-visible {
  background: #d62834;
}

@media (max-width: 900px) {
  .network-modal {
    width: min(620px, calc(100vw - 28px));
  }

  .network-modal--network {
    width: min(560px, calc(100vw - 28px));
  }

  .network-modal__header {
    padding: 28px 30px 16px;
  }

  .network-modal__body {
    padding: 0 30px 28px;
  }

  .network-modal__title,
  .network-modal--details .network-modal__title {
    font-size: 34px;
  }

  .network-modal__subtitle {
    font-size: 15px;
  }

  .network-modal-progress {
    grid-template-columns: repeat(5, 36px);
    gap: 28px;
    margin-bottom: 22px;
  }

  .network-modal-progress__item:not(:first-child)::before {
    right: calc(100% + 6px);
    width: 16px;
  }

  .network-modal-progress__dot {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .network-modal__question {
    font-size: 20px;
  }

  .network-modal-choice {
    min-height: 52px;
  }

  .network-modal-choice__label,
  .network-modal__field-label,
  .network-modal__input,
  .network-modal__secondary,
  .network-modal__continue {
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  .network-modal-overlay {
    align-items: end;
    padding: 10px;
  }

  .network-modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 16px;
  }

  .network-modal__close {
    right: 16px;
    top: 14px;
  }

  .network-modal__header,
  .network-modal--details .network-modal__header {
    padding: 30px 18px 12px;
  }

  .network-modal__body {
    padding: 0 18px 18px;
  }

  .network-modal__title,
  .network-modal--details .network-modal__title {
    font-size: 27px;
    line-height: 1.05;
  }

  .network-modal__subtitle {
    margin-top: 8px;
    font-size: 13px;
  }

  .network-modal-progress {
    grid-template-columns: repeat(5, 30px);
    gap: 12px;
    margin-bottom: 16px;
  }

  .network-modal-progress__item:not(:first-child)::before {
    right: calc(100% + 4px);
    width: 6px;
    height: 2px;
  }

  .network-modal-progress__dot {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .network-modal-progress__dot svg {
    width: 16px;
    height: 16px;
  }

  .network-modal__question {
    margin-bottom: 12px;
    font-size: 17px;
  }

  .network-modal__choices {
    gap: 9px;
  }

  .network-modal-choice {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 13px;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 25px;
  }

  .network-modal-choice__radio {
    width: 22px;
    height: 22px;
    border-width: 3px;
  }

  .network-modal-choice.is-selected .network-modal-choice__radio {
    box-shadow: inset 0 0 0 5px #ffffff;
  }

  .network-modal-choice__label,
  .network-modal__field-label,
  .network-modal__input,
  .network-modal-info__title,
  .network-modal__secondary,
  .network-modal__continue {
    font-size: 15px;
  }

  .network-modal__input {
    min-height: 48px;
    padding: 0 16px;
    border-radius: 25px;
  }

  .network-modal-info {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 12px;
    border-radius: 12px;
  }

  .network-modal-info__icon {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .network-modal-info__text,
  .network-option__desc {
    font-size: 11px;
  }

  .network-modal-info--wallet {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 11px;
  }

  .network-modal-info--wallet .network-modal-info__icon {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .network-modal-info--wallet .network-modal-info__title {
    font-size: 14px;
  }

  .network-modal-info--wallet .network-modal-info__text {
    font-size: 11px;
    line-height: 1.34;
  }

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

  .network-option {
    min-height: 122px;
    padding: 12px;
    border-radius: 8px;
  }

  .network-option::before {
    right: -58px;
    top: -68px;
    width: 116px;
    height: 116px;
  }

  .network-option::after {
    right: 12px;
    top: 12px;
    width: 17px;
    height: 17px;
  }

  .network-option__icon {
    width: 40px;
    height: 40px;
  }

  .network-option__icon img {
    width: 24px;
    height: 24px;
  }

  .network-option__name {
    font-size: 18px;
  }

  .network-option__desc {
    max-width: 120px;
    line-height: 1.28;
  }

  .network-modal__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  .network-modal__secondary,
  .network-modal__continue {
    min-height: 46px;
    border-radius: 999px;
    font-size: 13px;
  }
}
